https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119629

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bergner at gcc dot gnu.org
             Target|powerpc                     |powerpc-elf

--- Comment #1 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Alexandre Oliva from comment #0)
> - TARGET_64BIT seems to imply TARGET_POWERPC64, but TARGET_POWERPC64 doesn't
> imply TARGET_64BIT
I'll answer this first, since it affects your observations and questions. Yes,
TARGET_64BIT implies TARGET_POWERPC64 and yes, TARGET_POWERPC64 does not imply
TARGET_64BIT. Confusing I know!

TARGET_64BIT (ie, -m64) tells us whether the binary we are creating will be
running in 64-bit mode or not. TARGET_POWERPC64 (-mpowerpc64) tells us whether
we can emit 64-bit ISA instructions.  The confusion is that most 64-bit ISA
instructions execute just fine in 32-bit mode (ie, -m32) _when_ they are run on
64-bit hardware.  We do support and there are specialized use cases for -m32
-mpower64 compiles, which is when TARGET_64BIT can be false and
TARGET_POWERPC64 true. 


> cmpeqb's conditions are TARGET_P9_MISC && TARGET_64BIT,
This is correct, as the cmpeqb ISA description states that the instruction has
UB in 32-bit mode.  This is unlike many of our 64-bit load and store
instructions which do work in 32-bit mode, so they're gated by
TARGET_POWERPC64.



> but the conditions that enable the expansion of __builtin_scalar_byte_in_set
> are those of [power9-64], namely TARGET_MODULE && TARGET_POWERPC64.  
I believe this is a bug and this and the other [power*-64] tests should be
using TARGET_64BIT instead of TARGET_POWERPC64.



> On a powerpc-elf standard build, TARGET_POWERPC64 is enabled, but
> TARGET_64BIT isn't, and so gcc.target/powerpc/byte-in-set-2.c fails
> to compile with an ICE (instruction not recognized) instead of the
> expected error.

That powerpc-elf enables TARGET_POWERPC64 smells like a bug to me as well, but
not knowing who/what uses that target triplet, I cannot say for certain. 
Segher & Mike, do you agree that powerpc-elf should not be enabling
TARGET_POWERPC64 by default?  This does not happen on a powerpc-linux build.


Thank you for reporting this.

Reply via email to