public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P'
@ 2013-04-16 12:18 mgretton at gcc dot gnu.org
  2013-04-16 13:13 ` [Bug target/56979] " ktkachov at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: mgretton at gcc dot gnu.org @ 2013-04-16 12:18 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979

             Bug #: 56979
           Summary: ICE in output_operand: invalid operand for code 'P'
    Classification: Unclassified
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: mgretton@gcc.gnu.org


Created attachment 29882
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29882
Reduced testcase

The attached testcase causes the following ICE when compiled as shown:

$ arm-none-linux-gnueabi-g++ -fsigned-char -march=armv7-a -mfloat-abi=hard
-mfpu=neon -ftree-vectorize -fPIC besttry.c
besttry.c: In function ‘float2 operator-(float, float2)’:
besttry.c:7:1: internal compiler error: output_operand: invalid operand for
code 'P'
 }
 ^
0x86acde output_operand_lossage(char const*, ...)
        /work/sources/gcc-fsf/master/gcc/final.c:3303
0xcdf7ba arm_print_operand
        /work/sources/gcc-fsf/master/gcc/config/arm/arm.c:18336
0x86ad2e output_operand(rtx_def*, int)
        /work/sources/gcc-fsf/master/gcc/final.c:3725
0x86b70b output_asm_insn
        /work/sources/gcc-fsf/master/gcc/final.c:3604
0x86b70b output_asm_insn(char const*, rtx_def**)
        /work/sources/gcc-fsf/master/gcc/final.c:3493
0xcd6864 output_move_vfp(rtx_def**)
        /work/sources/gcc-fsf/master/gcc/config/arm/arm.c:15383
0x86c6e8 final_scan_insn(rtx_def*, _IO_FILE*, int, int, int*)
        /work/sources/gcc-fsf/master/gcc/final.c:2853
0x86da15 final(rtx_def*, _IO_FILE*, int)
        /work/sources/gcc-fsf/master/gcc/final.c:1957
0x86de29 rest_of_handle_final
        /work/sources/gcc-fsf/master/gcc/final.c:4332

Issue also seen on 4.7, and 4.8.

arm-none-linux-g++ -v: 
Using built-in specs.
COLLECT_GCC=/work/builds/gcc-fsf-master/tools/bin/arm-none-linux-gnueabi-g++
COLLECT_LTO_WRAPPER=/work/builds/gcc-fsf-master/tools/libexec/gcc/arm-none-linux-gnueabi/4.9.0/lto-wrapper
Target: arm-none-linux-gnueabi
Configured with: /work/sources/gcc-fsf/master/configure
--target=arm-none-linux-gnueabi --prefix=/work/builds/gcc-fsf-master/tools
--with-sysroot=/work/builds/gcc-fsf-master/sysroot-arm-none-linux-gnueabi
--disable-libssp --disable-libgomp --disable-libmudflap
--enable-languages=c,c++ --with-arch=armv7-a --with-fpu=vfpv3-d16
--with-float=softfp --with-thumb : (reconfigured)
/work/sources/gcc-fsf/master/configure --target=arm-none-linux-gnueabi
--prefix=/work/builds/gcc-fsf-master/tools
--with-sysroot=/work/builds/gcc-fsf-master/sysroot-arm-none-linux-gnueabi
--disable-libssp --disable-libgomp --disable-libmudflap --with-arch=armv7-a
--with-fpu=vfpv3-d16 --with-float=softfp --with-thumb
target_alias=arm-none-linux-gnueabi CC=gcc --enable-languages=c,c++,lto
--no-create --no-recursion
Thread model: posix
gcc version 4.9.0 20130416 (experimental) (GCC)
>From gcc-bugs-return-420383-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 16 12:45:41 2013
Return-Path: <gcc-bugs-return-420383-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10961 invoked by alias); 16 Apr 2013 12:45:41 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 10942 invoked by uid 48); 16 Apr 2013 12:45:38 -0000
From: "mgretton at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
Date: Tue, 16 Apr 2013 12:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mgretton at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-56979-4-E0U83u7lbq@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-56979-4@http.gcc.gnu.org/bugzilla/>
References: <bug-56979-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01528.txt.bz2
Content-length: 267


http://gcc.gnu.org/bugzilla/show_bug.cgi?idV979

--- Comment #1 from mgretton at gcc dot gnu.org 2013-04-16 12:45:38 UTC ---
Command line can be further reduced to

$ arm-none-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=hard -mfpu=neon
reduced-testcase.c


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
  2013-04-16 12:18 [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P' mgretton at gcc dot gnu.org
@ 2013-04-16 13:13 ` ktkachov at gcc dot gnu.org
  2013-08-03 21:52 ` rearnsha at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2013-04-16 13:13 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-04-16
                 CC|                            |ktkachov at gcc dot gnu.org
      Known to work|                            |4.6.4
     Ever Confirmed|0                           |1
      Known to fail|                            |4.7.3, 4.8.0, 4.9.0

--- Comment #2 from ktkachov at gcc dot gnu.org 2013-04-16 13:13:42 UTC ---
Reproduced on arm-none-eabi with trunk, 4.8, 4.7.
4.6 does not ICE.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
  2013-04-16 12:18 [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P' mgretton at gcc dot gnu.org
  2013-04-16 13:13 ` [Bug target/56979] " ktkachov at gcc dot gnu.org
@ 2013-08-03 21:52 ` rearnsha at gcc dot gnu.org
  2013-08-07  0:04 ` joseph at codesourcery dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2013-08-03 21:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979

--- Comment #3 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
The problem here is that float2 has alignment 8, although this is not it's
natural alignment (which would be 4).

This argument is passed by value to the routine operator-(float, float2), and
the compiler treats float2 as an HFA containing 2 floats; these get allocated
to s1 and s2 under the AAPCS VFP rules.  On entry to the function, the compiler
then tries to store s1 and s2 as a pairwise (64-bit) type to the stack (since
the type is 64-bit aligned) -- the latter fails because for this to work the
64-bit type must start with an even numbered register.

The AAPCS does not describe what happens when arguments do not have their
natural alignment -- most cases will almost certainly not work as expected,
particularly if the alignment is greater than the natural stack alignment.

Although the compiler shouldn't ICE, it's arguable that passing over-aligned
values by value to functions is not supportable (c11, for example, does not
support over-aligning function arguments even though it does permit
over-aligning some other objects) and that this case is really an ICE on
invalid.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
  2013-04-16 12:18 [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P' mgretton at gcc dot gnu.org
  2013-04-16 13:13 ` [Bug target/56979] " ktkachov at gcc dot gnu.org
  2013-08-03 21:52 ` rearnsha at gcc dot gnu.org
@ 2013-08-07  0:04 ` joseph at codesourcery dot com
  2013-08-08 13:36 ` rearnsha at gcc dot gnu.org
  2013-08-21 16:24 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: joseph at codesourcery dot com @ 2013-08-07  0:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979

--- Comment #4 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Sat, 3 Aug 2013, rearnsha at gcc dot gnu.org wrote:

> Although the compiler shouldn't ICE, it's arguable that passing over-aligned
> values by value to functions is not supportable (c11, for example, does not
> support over-aligning function arguments even though it does permit
> over-aligning some other objects) and that this case is really an ICE on
> invalid.

I see no such restriction in C11.  You can't use _Alignas directly on a 
parameter, but if you have somehow constructed an over-aligned type (and, 
as I noted on the WG14 reflector some time ago, and more recently in 
N1731, there is no syntax for doing so despite the discussion of such 
types in C11), being a struct or union with an alignment specifier used 
therein, nothing I see prohibits passing it to a function - it's simply 
implementation-defined whether that is a context in which such a type is 
supported.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
  2013-04-16 12:18 [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P' mgretton at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-08-07  0:04 ` joseph at codesourcery dot com
@ 2013-08-08 13:36 ` rearnsha at gcc dot gnu.org
  2013-08-21 16:24 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2013-08-08 13:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979

--- Comment #6 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Fixed with

    PR target/56979
    * arm.c (aapcs_vfp_allocate): Decompose the argument if the
    suggested mode for the assignment isn't compatible with the
    registers required.


On Trunk: r201598.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/56979] ICE in output_operand: invalid operand for code 'P'
  2013-04-16 12:18 [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P' mgretton at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-08-08 13:36 ` rearnsha at gcc dot gnu.org
@ 2013-08-21 16:24 ` rearnsha at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: rearnsha at gcc dot gnu.org @ 2013-08-21 16:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56979

Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.7.4

--- Comment #7 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Also fixed on 4.7 and 4.8:

4.7: r201904
4.8: r201903


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-21 16:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-16 12:18 [Bug target/56979] New: ICE in output_operand: invalid operand for code 'P' mgretton at gcc dot gnu.org
2013-04-16 13:13 ` [Bug target/56979] " ktkachov at gcc dot gnu.org
2013-08-03 21:52 ` rearnsha at gcc dot gnu.org
2013-08-07  0:04 ` joseph at codesourcery dot com
2013-08-08 13:36 ` rearnsha at gcc dot gnu.org
2013-08-21 16:24 ` rearnsha at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).