public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions
@ 2014-08-02 15:22 rmorell at nvidia dot com
  2014-08-02 18:33 ` [Bug target/61997] " pinskia at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: rmorell at nvidia dot com @ 2014-08-02 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61997
           Summary: cc1plus ICE with aarch64 target using PCH and builtin
                    functions
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rmorell at nvidia dot com

Created attachment 33226
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33226&action=edit
Test case

This reproduces with at least GCC 4.8.2, 4.8.3, and SVN r213491.  I believe
it's present in every version that supports the aarch64 target.

I have been using GCC configured with:
configure --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu
--target=aarch64-unknown-linux-gnu --enable-languages=c,c++
--enable-threads=posix --enable-shared --disable-libsanitizer
--disable-gnu-indirect-function --disable-gnu-unique-object
--with-sysroot=/gcc-debug/Linux-aarch64-sysroot --disable-multilib

The simplest reproduction case that I've found is to precompile a header with
exactle one line in it, call it precomp.h:
#define CEILF(f) ceilf(f)

Compile the PCH with:
aarch64-unknown-linux-gnu-gcc -nostdinc -march=armv8-a -fPIC -O2
-ftree-vectorize -x c++-header -c precomp.h -o precomp.h.ghc

Then build the attached longish creduce'd test case with:
aarch64-unknown-linux-gnu-gcc -nostdinc -march=armv8-a -fPIC -O2
-ftree-vectorize -x c++ -include precomp.h -Winvalid-pch -c test.c

It fails with SEGV:
test.c: In function ‘void x127()’:
test.c:141:1: internal compiler error: Segmentation fault
 x127 ()
 ^
0x899d958 crash_signal
    /gcc-debug/gcc-svn/gcc/toplev.c:337
0x81bbd62 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
    /gcc-debug/gcc-svn/gcc/tree.h:2841
0x87208ca gimple_build_call_1
    /gcc-debug/gcc-svn/gcc/gimple.c:216
0x872093d gimple_build_call_vec(tree_node*, vec<tree_node*, va_heap, vl_ptr>)
    /gcc-debug/gcc-svn/gcc/gimple.c:230
0x8bd85e0 vectorizable_call
    /gcc-debug/gcc-svn/gcc/tree-vect-stmts.c:2470
0x8be7b1f vect_transform_stmt(gimple_statement_base*, gimple_stmt_iterator*,
bool*, _slp_tree*, _slp_instance*)
    /gcc-debug/gcc-svn/gcc/tree-vect-stmts.c:7237
0x8bfb143 vect_transform_loop(_loop_vec_info*)
    /gcc-debug/gcc-svn/gcc/tree-vect-loop.c:6079
0x8c0e4f1 vectorize_loops()
    /gcc-debug/gcc-svn/gcc/tree-vectorizer.c:478
0x8b1c75c execute
    /gcc-debug/gcc-svn/gcc/tree-ssa-loop.c:232

It looks like the reason for the failure is that the global table
aarch64_builtin_decls in aarch64-builtins.c isn't relocated when loading the
PCH.  All of the nodes that it points to are freed, and the memory may get
reused (or poisoned, if that's enabled).

The table is properly annotated with the GTY macro, but aarch64-builtins.c
isn't in GTFILES so it's not processed by the type generator.

If I manually add aarch64-builtins.c to target_gtfiles (and include the
resulting gt-aarch64-builtins.h at the bottom of the C file) then this problem
goes away.
>From gcc-bugs-return-457616-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Aug 02 15:23:57 2014
Return-Path: <gcc-bugs-return-457616-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4187 invoked by alias); 2 Aug 2014 15:23:56 -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 4121 invoked by uid 48); 2 Aug 2014 15:23:53 -0000
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/29842] [meta-bug] outstanding patches / issues from STMicroelectronics
Date: Sat, 02 Aug 2014 15:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: 4.2.0
X-Bugzilla-Keywords: meta-bug
X-Bugzilla-Severity: normal
X-Bugzilla-Who: olegendo at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-29842-4-K4KxaQ9TVv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-29842-4@http.gcc.gnu.org/bugzilla/>
References: <bug-29842-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-08/txt/msg00113.txt.bz2
Content-length: 539

https://gcc.gnu.org/bugzilla/show_bug.cgi?id)842

--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Oleg Endo from comment #3)
> (In reply to Jorn Wolfgang Rennecke from comment #2)
> > For the -mrelax breakage, also see:
> > http://sourceware.org/bugzilla/show_bug.cgi?id298
>
> Fixes for -mrelax have been posted by Renesas in 2009:
>
> https://sourceware.org/bugzilla/show_bug.cgi?id\x10373
> https://sourceware.org/bugzilla/show_bug.cgi?id\x10378

These two issues have been now been fixed in binutils.


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
@ 2014-08-02 18:33 ` pinskia at gcc dot gnu.org
  2014-08-02 18:34 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-02 18:33 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-08-02
     Ever confirmed|0                           |1

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
  2014-08-02 18:33 ` [Bug target/61997] " pinskia at gcc dot gnu.org
@ 2014-08-02 18:34 ` pinskia at gcc dot gnu.org
  2014-08-02 18:38 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-02 18:34 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |aarch64*-*-*

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Also happens with a aarch64-elf gcc.


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
  2014-08-02 18:33 ` [Bug target/61997] " pinskia at gcc dot gnu.org
  2014-08-02 18:34 ` pinskia at gcc dot gnu.org
@ 2014-08-02 18:38 ` pinskia at gcc dot gnu.org
  2014-10-28 10:50 ` ramana at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-08-02 18:38 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Robert Morell from comment #0) 
> If I manually add aarch64-builtins.c to target_gtfiles (and include the
> resulting gt-aarch64-builtins.h at the bottom of the C file) then this
> problem goes away.

That is the correct fix.  I am testing this fix then and will be applying to
the trunk as obvious after I test it.


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
                   ` (2 preceding siblings ...)
  2014-08-02 18:38 ` pinskia at gcc dot gnu.org
@ 2014-10-28 10:50 ` ramana at gcc dot gnu.org
  2014-11-03 12:01 ` jgreenhalgh at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ramana at gcc dot gnu.org @ 2014-10-28 10:50 UTC (permalink / raw)
  To: gcc-bugs

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

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ramana at gcc dot gnu.org
   Target Milestone|---                         |5.0
      Known to fail|4.10.0                      |5.0


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
                   ` (3 preceding siblings ...)
  2014-10-28 10:50 ` ramana at gcc dot gnu.org
@ 2014-11-03 12:01 ` jgreenhalgh at gcc dot gnu.org
  2014-11-11 23:40 ` pinskia at gcc dot gnu.org
  2015-01-13  8:53 ` yroux at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jgreenhalgh at gcc dot gnu.org @ 2014-11-03 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

jgreenhalgh at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jgreenhalgh at gcc dot gnu.org

--- Comment #4 from jgreenhalgh at gcc dot gnu.org ---
Did the fix for this make it to trunk?


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
                   ` (4 preceding siblings ...)
  2014-11-03 12:01 ` jgreenhalgh at gcc dot gnu.org
@ 2014-11-11 23:40 ` pinskia at gcc dot gnu.org
  2015-01-13  8:53 ` yroux at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2014-11-11 23:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.


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

* [Bug target/61997] cc1plus ICE with aarch64 target using PCH and builtin functions
  2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
                   ` (5 preceding siblings ...)
  2014-11-11 23:40 ` pinskia at gcc dot gnu.org
@ 2015-01-13  8:53 ` yroux at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: yroux at gcc dot gnu.org @ 2015-01-13  8:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Yvan Roux <yroux at gcc dot gnu.org> ---
Author: yroux
Date: Tue Jan 13 08:52:55 2015
New Revision: 219522

URL: https://gcc.gnu.org/viewcvs?rev=219522&root=gcc&view=rev
Log:
2015-01-13  Michael Collison  <michael.collison@linaro.org>

    Backport from trunk r217394.
    2014-11-11  Andrew Pinski  <apinski@cavium.com>

    Bug target/61997
    * config.gcc (aarch64*-*-*): Set target_gtfiles to include
    aarch64-builtins.c.
    * config/aarch64/aarch64-builtins.c: Include gt-aarch64-builtins.h
    at the end of the file.


Modified:
    branches/linaro/gcc-4_9-branch/gcc/ChangeLog.linaro
    branches/linaro/gcc-4_9-branch/gcc/config.gcc
    branches/linaro/gcc-4_9-branch/gcc/config/aarch64/aarch64-builtins.c


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

end of thread, other threads:[~2015-01-13  8:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-02 15:22 [Bug target/61997] New: cc1plus ICE with aarch64 target using PCH and builtin functions rmorell at nvidia dot com
2014-08-02 18:33 ` [Bug target/61997] " pinskia at gcc dot gnu.org
2014-08-02 18:34 ` pinskia at gcc dot gnu.org
2014-08-02 18:38 ` pinskia at gcc dot gnu.org
2014-10-28 10:50 ` ramana at gcc dot gnu.org
2014-11-03 12:01 ` jgreenhalgh at gcc dot gnu.org
2014-11-11 23:40 ` pinskia at gcc dot gnu.org
2015-01-13  8:53 ` yroux 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).