% cat test.c                               
union prop_data_t
    unsigned int u;
        unsigned short s1;
        unsigned short s2;

union prop_data_t broken (int a, int b)
    union prop_data_t var;

    if (a)
        var.s2 = 0;
        var.s2 = b ? a : 2;
        if (var.s2)
            return var;

    var.u = 0;
    return var;
% echo $CC
% $CC -mcpu=arm9tdmi -c test.c -O -pipe   
{standard input}: Assembler messages:
{standard input}:25: Error: selected processor does not support ARM mode
`movteq r0,2'
% $CC -mcpu=arm9tdmi -c test.c -Ofast -pipe
{standard input}: Assembler messages:
{standard input}:23: Error: selected processor does not support ARM mode
`movteq r3,2'
% $CC -mcpu=arm9tdmi -c test.c -pipe   
% $CC -v                               
Using built-in specs.
Target: arm-elf-eabi
Configured with: ../gcc-4.6-20100918/configure
--prefix=/usr/local/arm-elf-eabi-cvs --target=arm-elf-eabi --enable-lto
--enable-languages=c --disable-docs --disable-libssp
Thread model: single
gcc version 4.6.0 20100918 (experimental) (GCC) 

Using 20100918 snapshot

reduced from

I tried to see which optimization broke with -Ox -Q --help=optimizers but the
list printed doesn't seem to be complete.

           Summary: Thumb2 instruction emitted for incompatible CPU
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rafael dot carre at gmail dot com
GCC target triplet: arm-elf-eabi


Reply via email to