[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread emilio at crisal dot io
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 Emilio Cobos Álvarez (:emilio) changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolu

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 --- Comment #9 from Jakub Jelinek --- (In reply to Emilio Cobos Álvarez (:emilio) from comment #8) > Another point that someone made in the Mozilla bug tracker is that the ABI, > in the "Scalar Types" table, specifies that enums are represented a

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread emilio at crisal dot io
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 --- Comment #8 from Emilio Cobos Álvarez (:emilio) --- (In reply to Jakub Jelinek from comment #6) > Note that for most types one ends up with zero or sign extension already due > to C/C++ promotion rules, though in the ABI still can't use that a

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 --- Comment #7 from Jakub Jelinek --- Related links: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942 https://groups.google.com/forum/?hl=en#!topic/x86-64-abi/E8O33onbnGQ

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 --- Comment #6 from Jakub Jelinek --- Note that for most types one ends up with zero or sign extension already due to C/C++ promotion rules, though in the ABI still can't use that as guarantee, but C++ typed enums aren't promoted.

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread matz at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 --- Comment #5 from Michael Matz --- Yes, we (intentionally) haven't required any extensions to happen for arguments or return values smaller than 64bit (e.g. we haven't even specified that arguments <= 32bit would be zero-extended in the high bi

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread emilio at crisal dot io
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 Emilio Cobos Álvarez (:emilio) changed: What|Removed |Added See Also||https://bugs.llvm.org/sh

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread emilio at crisal dot io
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 --- Comment #3 from Emilio Cobos Álvarez (:emilio) --- If my reading of https://godbolt.org/z/BNHxEY is correct (sorry, still a bit of a noob with disassembly), it looks like GCC does correctly load only the low byte in the equivalent implementat

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 Jakub Jelinek changed: What|Removed |Added CC||hjl.tools at gmail dot com,

[Bug target/92821] Miscompilation when passing 8-bit enum to extern function

2019-12-05 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92821 Jonathan Wakely changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #