public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "su at cs dot ucdavis.edu" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58997] New: ICE on valid code at -O3 on x86_64-linux-gnu (affecting gcc trunk and 4.8.2)
Date: Tue, 05 Nov 2013 06:24:00 -0000	[thread overview]
Message-ID: <bug-58997-4@http.gcc.gnu.org/bugzilla/> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 10199 bytes --]

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

            Bug ID: 58997
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu
                    (affecting gcc trunk and 4.8.2)
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

The following code causes an ICE when compiled with the current gcc trunk and
4.8.2 at -O3 on x86_64-linux-gnu (in both 32-bit and 64-bit modes). 

It is a regression from 4.8.1. 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure
--enable-languages=c,c++,objc,obj-c++,fortran,lto --disable-werror
--enable-checking=release --with-gmp=/usr/local/gcc-trunk
--with-mpfr=/usr/local/gcc-trunk --with-mpc=/usr/local/gcc-trunk
--with-cloog=/usr/local/gcc-trunk --prefix=/usr/local/gcc-trunk
Thread model: posix
gcc version 4.9.0 20131105 (experimental) [trunk revision 204377] (GCC) 
$ 
$ gcc-trunk -O2 small.c; a.out
$ gcc-4.8.1 -O3 small.c; a.out
$ 
$ gcc-trunk -O3 small.c
small.c: In function ‘foo’:
small.c:18:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5901
 }
 ^
0x82fdca simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int)
    ../../gcc-trunk/gcc/simplify-rtx.c:5900
0x830169 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned
int)
    ../../gcc-trunk/gcc/simplify-rtx.c:6121
0x74a138 iv_subreg
    ../../gcc-trunk/gcc/loop-iv.c:439
0x74a138 iv_analyze_op
    ../../gcc-trunk/gcc/loop-iv.c:1164
0x74a257 iv_analyze_expr(rtx_def*, rtx_def*, machine_mode, rtx_iv*)
    ../../gcc-trunk/gcc/loop-iv.c:971
0x74a8c4 iv_analyze_def
    ../../gcc-trunk/gcc/loop-iv.c:1122
0x749fea iv_analyze_op
    ../../gcc-trunk/gcc/loop-iv.c:1193
0x7516ef may_unswitch_on
    ../../gcc-trunk/gcc/loop-unswitch.c:201
0x7516ef unswitch_single_loop
    ../../gcc-trunk/gcc/loop-unswitch.c:324
0x751c9c unswitch_single_loop
    ../../gcc-trunk/gcc/loop-unswitch.c:379
0x751f30 unswitch_loops()
    ../../gcc-trunk/gcc/loop-unswitch.c:148
0x742cb7 rtl_unswitch
    ../../gcc-trunk/gcc/loop-init.c:537
0x742cb7 execute
    ../../gcc-trunk/gcc/loop-init.c:567
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 
$ gcc-4.8.2 -O3 small.c; a.out
small.c: In function ‘foo’:
small.c:18:1: internal compiler error: in simplify_subreg, at
simplify-rtx.c:5732
 }
 ^
0x7bf858 simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int)
    ../../gcc-4.8.2/gcc/simplify-rtx.c:5731
0x7c5c18 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned
int)
    ../../gcc-4.8.2/gcc/simplify-rtx.c:5952
0x6f6438 iv_subreg
    ../../gcc-4.8.2/gcc/loop-iv.c:428
0x6f6438 iv_analyze_op
    ../../gcc-4.8.2/gcc/loop-iv.c:1154
0x6f5a2a iv_analyze_expr(rtx_def*, rtx_def*, machine_mode, rtx_iv*)
    ../../gcc-4.8.2/gcc/loop-iv.c:961
0x6f6094 iv_analyze_def
    ../../gcc-4.8.2/gcc/loop-iv.c:1112
0x6f62ea iv_analyze_op
    ../../gcc-4.8.2/gcc/loop-iv.c:1183
0x6fce35 may_unswitch_on
    ../../gcc-4.8.2/gcc/loop-unswitch.c:201
0x6fce35 unswitch_single_loop
    ../../gcc-4.8.2/gcc/loop-unswitch.c:324
0x6fd3f4 unswitch_single_loop
    ../../gcc-4.8.2/gcc/loop-unswitch.c:379
0x6fd628 unswitch_loops()
    ../../gcc-4.8.2/gcc/loop-unswitch.c:148
0x6f00a7 rtl_unswitch
    ../../gcc-4.8.2/gcc/loop-init.c:453
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 
$ 


-------------------------------


int a, b, c, e;
short d;
char h;

int
foo ()
{
  for (; b;)
    {
      d = a ? c : 1 % a;
      c = d;
      h = d;
      if (!h) 
    for (; e;)
      ;
    }
  return 0;
}

int
main ()
{
  foo ();
  return 0;
}
>From gcc-bugs-return-433518-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 05 06:24:23 2013
Return-Path: <gcc-bugs-return-433518-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4837 invoked by alias); 5 Nov 2013 06:24:23 -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 3598 invoked by uid 48); 5 Nov 2013 06:22:19 -0000
From: "PHHargrove at lbl dot gov" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug other/58996] New: [4.9 regression] build failure in libcilkrts
Date: Tue, 05 Nov 2013 06:24:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: other
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: PHHargrove at lbl dot gov
X-Bugzilla-Status: UNCONFIRMED
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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-58996-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: 2013-11/txt/msg00295.txt.bz2
Content-length: 4083

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

            Bug ID: 58996
           Summary: [4.9 regression] build failure in libcilkrts
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: PHHargrove at lbl dot gov

I have an ancient x86 system running Red Hat 8.

This system's version of Linux and/or glibc lacks definitions of cpu_set_t and
CPU_SETSIZE:
$ grep -rl -e CPU_SETSIZE -e cpu_set_t /usr/include
[no output]

So, starting very recently, builds from SVN fail as shown below.

Of course I can (and will) work-around with with --disable-libclikrts.
However, I believe a configure probe for the required support would be
appropriate.

-Paul

libtool: compile:  /usr/local/pkg/upc/nightly/compiler/bld/./gcc/xgcc
-B/usr/local/pkg/upc/nightly/compiler/bld/./gcc/
-B/usr/local/pkg/upc/nightly/compiler/install/i686-pc-linux-gnu/bin/
-B/usr/local/pkg/upc/nightly/compiler/install/i686-pc-linux-gnu/lib/ -isystem
/usr/local/pkg/upc/nightly/compiler/install/i686-pc-linux-gnu/include -isystem
/usr/local/pkg/upc/nightly/compiler/install/i686-pc-linux-gnu/sys-include
"-DPACKAGE_NAME=\"Cilk Runtime Library\""
-DPACKAGE_TARNAME=\"cilk-runtime-library\" -DPACKAGE_VERSION=\"2.0\"
"-DPACKAGE_STRING=\"Cilk Runtime Library 2.0\""
-DPACKAGE_BUGREPORT=\"cilk@intel.com\" -DPACKAGE_URL=\"\"
-DPACKAGE=\"cilk-runtime-library\" -DVERSION=\"2.0\" -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1
-DHAVE_UNISTD_H=1 -DHAVE_ALLOCA_H=1 -DHAVE_ALLOCA=1 -DHAVE_DLFCN_H=1
-DLT_OBJDIR=\".libs/\" -I.
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/include
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/config/x86
-DIN_CILK_RUNTIME=1 -D_Cilk_spawn= -D_Cilk_sync= -D_Cilk_for=for -fcilkplus
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/include
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime
-I/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/config/x86
-DIN_CILK_RUNTIME=1 -D_Cilk_spawn= -D_Cilk_sync= -D_Cilk_for=for -fcilkplus
-stdÉ9 -O2 -g -O0 -MT os-unix.lo -MD -MP -MF .deps/os-unix.Tpo -c
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c
-fPIC -DPIC -o .libs/os-unix.o
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c: In
function 'linux_get_affinity_count':
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c:311:5:
error: unknown type name 'cpu_set_t'
     cpu_set_t process_mask;
     ^
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c:314:5:
warning: passing argument 3 of 'sched_getaffinity' from incompatible pointer
type [enabled by default]
     int err = sched_getaffinity (tid, sizeof(process_mask),&process_mask);
     ^
In file included from /usr/include/pthread.h:20:0,
                 from
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c:75:
/usr/include/sched.h:72:12: note: expected 'long unsigned int *' but argument
is of type 'int *'
 extern int sched_getaffinity (__pid_t __pid, unsigned int __len,
            ^
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c:328:21:
error: 'CPU_SETSIZE' undeclared (first use in this function)
     for (i = 0; i < CPU_SETSIZE; i++)
                     ^
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c:328:21:
note: each undeclared identifier is reported only once for each function it
appears in
/usr/local/pkg/upc/nightly/compiler/gupc-src/libcilkrts/runtime/os-unix.c:330:9:
warning: implicit declaration of function 'CPU_ISSET'
[-Wimplicit-function-declaration]
         if (CPU_ISSET(i, &process_mask))
         ^
make[2]: *** [os-unix.lo] Error 1


             reply	other threads:[~2013-11-05  6:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05  6:24 su at cs dot ucdavis.edu [this message]
2013-11-05  9:41 ` [Bug rtl-optimization/58997] [4.7/4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-11-05  9:41 ` [Bug rtl-optimization/58997] " jakub at gcc dot gnu.org
2013-11-05 19:39 ` [Bug rtl-optimization/58997] [4.7/4.8/4.9 Regression] " jakub at gcc dot gnu.org
2013-11-19 13:35 ` [Bug rtl-optimization/58997] [4.7 " rguenth at gcc dot gnu.org
2014-06-12 13:31 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-58997-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).