public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/65321] New: ICE on valid code at -O2 and -O3 with -g enabled in decompose, at rtl.h:2007
@ 2015-03-05  5:59 su at cs dot ucdavis.edu
  2015-03-05  8:49 ` [Bug target/65321] " mpolacek at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: su at cs dot ucdavis.edu @ 2015-03-05  5:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65321
           Summary: ICE on valid code at -O2 and -O3 with -g enabled in
                    decompose, at rtl.h:2007
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          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 at
-O2 and -O3 with -g enabled on x86_64-linux-gnu in both 32-bit and 64-bit
modes.

This is a regression from 4.9.x.


$ 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/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 5.0.0 20150304 (experimental) [trunk revision 221192] (GCC) 
$ 
$ gcc-trunk -O2 -c small.c
$ gcc-4.9.2 -O2 -g -c small.c
$ 
$ gcc-trunk -O2 -g -c small.c
small.c: In function ‘fn1’:
small.c:27:1: internal compiler error: in decompose, at rtl.h:2007
 }
 ^
0xae1a87 wi::int_traits<std::pair<rtx_def*, machine_mode> >::decompose(long*,
unsigned int, std::pair<rtx_def*, machine_mode> const&)
    ../../gcc-trunk/gcc/rtl.h:2005
0xae1a87 wide_int_ref_storage<false>::wide_int_ref_storage<std::pair<rtx_def*,
machine_mode> >(std::pair<rtx_def*, machine_mode> const&, unsigned int)
    ../../gcc-trunk/gcc/wide-int.h:957
0xae1a87 generic_wide_int<wide_int_ref_storage<false>
>::generic_wide_int<std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&, unsigned int)
    ../../gcc-trunk/gcc/wide-int.h:733
0xae1a87 wi::binary_traits<std::pair<rtx_def*, machine_mode>,
std::pair<rtx_def*, machine_mode>, wi::int_traits<std::pair<rtx_def*,
machine_mode> >::precision_type, wi::int_traits<std::pair<rtx_def*,
machine_mode> >::precision_type>::result_type wi::sub<std::pair<rtx_def*,
machine_mode>, std::pair<rtx_def*, machine_mode> >(std::pair<rtx_def*,
machine_mode> const&, std::pair<rtx_def*, machine_mode> const&)
    ../../gcc-trunk/gcc/wide-int.h:2357
0xae1a87 simplify_const_binary_operation(rtx_code, machine_mode, rtx_def*,
rtx_def*)
    ../../gcc-trunk/gcc/simplify-rtx.c:3934
0xaded4f simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
    ../../gcc-trunk/gcc/simplify-rtx.c:1987
0x7791f3 cselib_expand_value_rtx_1
    ../../gcc-trunk/gcc/cselib.c:1843
0x77a38e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
    ../../gcc-trunk/gcc/cselib.c:1551
0xd88005 vt_expand_var_loc_chain
    ../../gcc-trunk/gcc/var-tracking.c:8310
0xd88005 vt_expand_loc_callback
    ../../gcc-trunk/gcc/var-tracking.c:8472
0x779102 cselib_expand_value_rtx_1
    ../../gcc-trunk/gcc/cselib.c:1704
0x77a38e cselib_expand_value_rtx_cb(rtx_def*, bitmap_head*, int, rtx_def*
(*)(rtx_def*, bitmap_head*, int, void*), void*)
    ../../gcc-trunk/gcc/cselib.c:1551
0xd88bb1 vt_expand_var_loc_chain
    ../../gcc-trunk/gcc/var-tracking.c:8310
0xd88bb1 vt_expand_1pvar
    ../../gcc-trunk/gcc/var-tracking.c:8585
0xd88bb1 emit_note_insn_var_location(variable_def**, emit_note_data_def*)
    ../../gcc-trunk/gcc/var-tracking.c:8640
0xd92403 void hash_table<variable_hasher, xcallocator,
false>::traverse_noresize<emit_note_data_def*,
&(emit_note_insn_var_location(variable_def**,
emit_note_data_def*))>(emit_note_data_def*)
    ../../gcc-trunk/gcc/hash-table.h:1057
0xd92403 void hash_table<variable_hasher, xcallocator,
false>::traverse<emit_note_data_def*,
&(emit_note_insn_var_location(variable_def**,
emit_note_data_def*))>(emit_note_data_def*)
    ../../gcc-trunk/gcc/hash-table.h:1079
0xd92403 emit_notes_for_changes
    ../../gcc-trunk/gcc/var-tracking.c:9000
0xd94140 emit_notes_in_bb
    ../../gcc-trunk/gcc/var-tracking.c:9432
0xd94140 vt_emit_notes
    ../../gcc-trunk/gcc/var-tracking.c:9495
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, d, e;

int
fn1 ()
{
  int h;
  char i;
  for (; c > 0;)
    {
      for (d = 0; d < 2; d++)
    {
      i = 1 << d;
      if (i - a)
        {
          e = b = 0;
          for (; c; c--)
        d = 127;
        }
    }
      h = ~d;
      if (h > c)
    for (;;)
      ;
      return 0;
    }
  return 0;
}
>From gcc-bugs-return-479417-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 05 06:40:00 2015
Return-Path: <gcc-bugs-return-479417-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 86731 invoked by alias); 5 Mar 2015 06:40:00 -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 86641 invoked by uid 48); 5 Mar 2015 06:39:57 -0000
From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/65067] regression on accessing volatile bit field
Date: Thu, 05 Mar 2015 06:40:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: major
X-Bugzilla-Who: bernd.edlinger at hotmail dot de
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:
Message-ID: <bug-65067-4-ZD7VI3MWiL@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65067-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65067-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: 2015-03/txt/msg00561.txt.bz2
Content-length: 820

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide067

--- Comment #10 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Tony Liu from comment #9)
> (In reply to Bernd Edlinger from comment #8)
> > Created attachment 34955 [details]
> > Proposed Fix
> >
> > Well, I noticed that the first version of this patch caused
> > a small but measurable decrease of code quality on x86_64,
> > so I moved the patch to the if (strict_volatile_bitfield_p block,
> > and used some code transformations to simplify the resulting code
> > a bit.
> >
> > I will post this new version for review, after a full boot-strap
> > and successful regression-test on my ARM target.
>
> I've tested for target Cortex-M3, no regression.

Oh, thanks.  This was really speedy!

Then I am clear to post the patch in a moment.


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

end of thread, other threads:[~2015-03-10  6:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-05  5:59 [Bug target/65321] New: ICE on valid code at -O2 and -O3 with -g enabled in decompose, at rtl.h:2007 su at cs dot ucdavis.edu
2015-03-05  8:49 ` [Bug target/65321] " mpolacek at gcc dot gnu.org
2015-03-05  8:51 ` [Bug debug/65321] " mpolacek at gcc dot gnu.org
2015-03-05  9:17 ` [Bug rtl-optimization/65321] [5 Regression] " rguenth at gcc dot gnu.org
2015-03-05 11:07 ` rguenth at gcc dot gnu.org
2015-03-05 20:54 ` rsandifo at gcc dot gnu.org
2015-03-06  8:41 ` rguenther at suse dot de
2015-03-07 10:32 ` rsandifo at gcc dot gnu.org
2015-03-07 15:09 ` law at redhat dot com
2015-03-09  8:20 ` jakub at gcc dot gnu.org
2015-03-09 10:18 ` rguenth at gcc dot gnu.org
2015-03-09 12:05 ` rsandifo at gcc dot gnu.org
2015-03-10  6:37 ` jakub at gcc dot gnu.org
2015-03-10  6:43 ` jakub 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).