public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions
@ 2012-05-06 22:40 danglin at gcc dot gnu.org
  2012-05-07  9:21 ` [Bug c++/53261] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-05-06 22:40 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53261
           Summary: [4.8 Regression] ICE in tree_strip_nop_conversions
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: danglin@gcc.gnu.org
              Host: hppa*-*-* (32-bit)
            Target: hppa*-*-* (32-bit)
             Build: hppa*-*-* (32-bit)


Created attachment 27329
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27329
Preprocessed source

/home/dave/gnu/gcc/objdir/./prev-gcc/g++ -B/home/d
ave/gnu/gcc/objdir/./prev-gcc/
-B/home/dave/opt/gnu/gcc/gcc-4.7.0/hppa-linux-gnu
/bin/ -nostdinc++
-B/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/s
rc/.libs
-B/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/libsupc++/
.libs
-I/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include/hppa-
linux-gnu -I/home/dave/gnu/gcc/objdir/prev-hppa-linux-gnu/libstdc++-v3/include
-
I/home/dave/gnu/gcc/gcc/libstdc++-v3/libsupc++
-L/home/dave/gnu/gcc/objdir/prev-
hppa-linux-gnu/libstdc++-v3/src/.libs
-L/home/dave/gnu/gcc/objdir/prev-hppa-linu
x-gnu/libstdc++-v3/libsupc++/.libs  -I../../gcc/libcpp -I.
-I../../gcc/libcpp/..
/include -I../../gcc/libcpp/include  -g -O2 -W -Wall -Wno-narrowing
-Wwrite-stri
ngs -Wmissing-format-attribute -pedantic -Wno-long-long -Werror -fno-exceptions 
-fno-rtti -I../../gcc/libcpp -I. -I../../gcc/libcpp/../include
-I../../gcc/libcp
p/include  -c -o files.o -MT files.o -MMD -MP -MF .deps/files.Tpo
../../gcc/libc
pp/files.c
../../gcc/libcpp/files.c: In function ‘bool pch_open_file(cpp_reader*,
_cpp_file
*, bool*)’:
../../gcc/libcpp/files.c:288:43: internal compiler error: Segmentation fault
   if (file->name[0] == '\0' || !pfile->cb.valid_pch)

Program received signal SIGSEGV, Segmentation fault.
tree_strip_nop_conversions (exp=0x0) at ../../gcc/gcc/tree.c:11211
11211      while (tree_nop_conversion (exp))
(gdb) bt
#0  tree_strip_nop_conversions (exp=0x0) at ../../gcc/gcc/tree.c:11211
#1  0x00954b9c in integer_zerop (expr=<optimized out>)
    at ../../gcc/gcc/tree.c:1731
#2  0x002d6f2c in warn_logical_operator (location=1226970, 
    code=<optimized out>, type=0x40f4e660, code_left=<optimized out>, 
    op_left=0x4130f260, code_right=EQ_EXPR, op_right=0x4130f2e0)
    at ../../gcc/gcc/c-family/c-common.c:1647
#3  0x00096944 in build_new_op_1 (loc=1226970, code=TRUTH_ORIF_EXPR, flags=3, 
    arg1=0x4130f260, arg2=0x4130f2e0, arg3=<optimized out>, 
    overload=0xfbf02df8, complain=3) at ../../gcc/gcc/cp/call.c:5261
#4  0x00096aa4 in build_new_op (loc=1093726944, code=TRUTH_ORIF_EXPR, 
    flags=1089803568, arg1=0x0, arg2=0x4130f2e0, arg3=0x0, 
    overload=0xfbf02df8, complain=3) at ../../gcc/gcc/cp/call.c:5326
#5  0x001f4568 in build_x_binary_op (loc=1089803568, code=TRUTH_ORIF_EXPR, 
    arg1=0x0, arg1_code=1226970, arg2=0x4130f260, arg2_code=ERROR_MARK, 
    overload=0xfbf02df8, complain=3) at ../../gcc/gcc/cp/typeck.c:3608
#6  0x001d1f54 in cp_parser_binary_expression (parser=0x4130f2e0, 
    cast_p=<optimized out>, no_toplevel_fold_p=<optimized out>, 
    prec=PREC_INCLUSIVE_OR_EXPRESSION, pidk=0x0)
    at ../../gcc/gcc/cp/parser.c:7399
#7  0x001d2168 in cp_parser_assignment_expression (parser=0x4102e460, 
    cast_p=<optimized out>, pidk=0x0) at ../../gcc/gcc/cp/parser.c:7504
#8  0x001d8b34 in cp_parser_expression (parser=0x4102e460, 
---Type <return> to continue, or q <return> to quit---
    cast_p=<optimized out>, pidk=0x0) at ../../gcc/gcc/cp/parser.c:7650
#9  0x001db68c in cp_parser_condition (parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:9281
#10 0x001c2cb0 in cp_parser_selection_statement (if_p=0x0, parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:9058
#11 cp_parser_statement (parser=0x4102e460, in_statement_expr=0x0, 
    in_compound=<optimized out>, if_p=0x0) at ../../gcc/gcc/cp/parser.c:8645
#12 0x001c434c in cp_parser_statement_seq_opt (parser=0x0, 
    in_statement_expr=0x4f) at ../../gcc/gcc/cp/parser.c:9004
#13 0x001c45a8 in cp_parser_compound_statement (parser=0x0, 
    in_statement_expr=0x12b8c0, in_try=<optimized out>, 
    function_body=<optimized out>) at ../../gcc/gcc/cp/parser.c:8958
#14 0x001dfd2c in cp_parser_function_body (parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:17422
#15 cp_parser_ctor_initializer_opt_and_function_body (parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:17456
#16 0x001e0408 in cp_parser_function_definition_after_declarator (parser=0x0, 
    inline_p=<optimized out>) at ../../gcc/gcc/cp/parser.c:21069
#17 0x001e09ac in cp_parser_function_definition_from_specifiers_and_declarator
    (declarator=0xd6d370, attributes=0x0, decl_specifiers=<optimized out>, 
    parser=0x4102e460) at ../../gcc/gcc/cp/parser.c:20989
#18 cp_parser_init_declarator (parser=0x4102e460, 
    decl_specifiers=<optimized out>, checks=0x0, 
---Type <return> to continue, or q <return> to quit---
    function_definition_allowed_p=<optimized out>, member_p=0 '\000', 
    declares_class_or_enum=0, function_definition_p=0xfbf02724 "\001ѹ$", 
    maybe_range_for_decl=0x0) at ../../gcc/gcc/cp/parser.c:15584
#19 0x001e2018 in cp_parser_simple_declaration (parser=0x4102e460, 
    function_definition_allowed_p=112 'p', maybe_range_for_decl=0x46)
    at ../../gcc/gcc/cp/parser.c:10427
#20 0x001e48c4 in cp_parser_block_declaration (parser=0x4102e460, 
    statement_p=<optimized out>) at ../../gcc/gcc/cp/parser.c:10313
#21 0x001e9a14 in cp_parser_declaration (parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:10210
#22 0x001e8350 in cp_parser_declaration_seq_opt (parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:10096
#23 0x001ea034 in cp_parser_translation_unit (parser=0x4102e460)
    at ../../gcc/gcc/cp/parser.c:3797
#24 c_parse_file () at ../../gcc/gcc/cp/parser.c:27449
#25 0x0031a5e8 in c_common_parse_file ()
    at ../../gcc/gcc/c-family/c-opts.c:1128
#26 0x0071ac28 in compile_file () at ../../gcc/gcc/toplev.c:551
#27 do_compile () at ../../gcc/gcc/toplev.c:1874
#28 toplev_main (argc=23, argv=0xfbf02028) at ../../gcc/gcc/toplev.c:1950
#29 0x00af1934 in main (argc=<optimized out>, argv=<optimized out>)
    at ../../gcc/gcc/main.c:36
(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0x953c9c to 0x953cbc:
   0x00953c9c <tree_strip_nop_conversions+256>:    ldil L%4000,r23
   0x00953ca0 <tree_strip_nop_conversions+260>:    b,l 0x938814
<tree_operand_check_failed>,rp
   0x00953ca4 <tree_strip_nop_conversions+264>:    ldo -1434(r23),r23
   0x00953ca8 <tree_strip_nop_conversions+268>:    ldw 14(r3),r3
=> 0x00953cac <tree_strip_nop_conversions+272>:    ldh 0(r3),ret0
   0x00953cb0 <tree_strip_nop_conversions+276>:    cmpb,= r9,ret0,0x953cc0
<tree_strip_nop_conversions+292>
   0x00953cb4 <tree_strip_nop_conversions+280>:    ldo 570(r4),r19
   0x00953cb8 <tree_strip_nop_conversions+284>:    cmpclr,= r12,ret0,r0
End of assembler dump.
(gdb) p/x $r3
$1 = 0x0

r187158 was ok.


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
@ 2012-05-07  9:21 ` rguenth at gcc dot gnu.org
  2012-05-07 11:30 ` danglin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-05-07  9:21 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.0


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
  2012-05-07  9:21 ` [Bug c++/53261] " rguenth at gcc dot gnu.org
@ 2012-05-07 11:30 ` danglin at gcc dot gnu.org
  2012-05-07 15:38 ` paolo.carlini at oracle dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: danglin at gcc dot gnu.org @ 2012-05-07 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from John David Anglin <danglin at gcc dot gnu.org> 2012-05-07 11:18:06 UTC ---
Introduced in r187194.


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
  2012-05-07  9:21 ` [Bug c++/53261] " rguenth at gcc dot gnu.org
  2012-05-07 11:30 ` danglin at gcc dot gnu.org
@ 2012-05-07 15:38 ` paolo.carlini at oracle dot com
  2012-05-07 16:29 ` manu at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-05-07 15:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-05-07 15:11:54 UTC ---
In general, build_range_check can return NULL_TREE. Just matter of doing:

    if (tem && integer_zerop (tem))
      return;

like a few lines below?


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2012-05-07 15:38 ` paolo.carlini at oracle dot com
@ 2012-05-07 16:29 ` manu at gcc dot gnu.org
  2012-05-08 15:28 ` dave.anglin at bell dot net
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2012-05-07 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-05-07 16:25:11 UTC ---
(In reply to comment #2)
> In general, build_range_check can return NULL_TREE. Just matter of doing:
> 
>     if (tem && integer_zerop (tem))
>       return;
> 
> like a few lines below?

I think you are right. I have launched a bootstrap+regtest with this patch:

Index: gcc/c-family/c-common.c
===================================================================
--- gcc/c-family/c-common.c     (revision 187257)
+++ gcc/c-family/c-common.c     (working copy)
@@ -1627,11 +1627,11 @@ warn_logical_operator (location_t locati
      should be always false to get a warning.  */
   if (or_op)
     in0_p = !in0_p;

   tem = build_range_check (UNKNOWN_LOCATION, type, lhs, in0_p, low0, high0);
-  if (integer_zerop (tem))
+  if (tem && integer_zerop (tem))
     return;

   rhs = make_range (op_right, &in1_p, &low1, &high1, &strict_overflow_p);
   if (!rhs)
     return;
@@ -1642,11 +1642,11 @@ warn_logical_operator (location_t locati
      should be always false to get a warning.  */
   if (or_op)
     in1_p = !in1_p;

   tem = build_range_check (UNKNOWN_LOCATION, type, rhs, in1_p, low1, high1);
-  if (integer_zerop (tem))
+  if (tem && integer_zerop (tem))
     return;

   /* If both expressions have the same operand, if we can merge the
      ranges, and if the range test is always false, then warn.  */
   if (operand_equal_p (lhs, rhs, 0)



Could you test on hppa?


Actually, I am not sure whether "if (!tem || integer_zerop (tem))" is even
better.


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2012-05-07 16:29 ` manu at gcc dot gnu.org
@ 2012-05-08 15:28 ` dave.anglin at bell dot net
  2012-05-08 22:19 ` manu at gcc dot gnu.org
  2012-05-08 22:22 ` manu at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: dave.anglin at bell dot net @ 2012-05-08 15:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from dave.anglin at bell dot net 2012-05-08 15:26:51 UTC ---
On 5/7/2012 12:25 PM, manu at gcc dot gnu.org wrote:
> Could you test on hppa?
The patch fixes the compilation error.
>
>
> Actually, I am not sure whether "if (!tem || integer_zerop (tem))" is even
> better.
>

Dave


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-05-08 15:28 ` dave.anglin at bell dot net
@ 2012-05-08 22:19 ` manu at gcc dot gnu.org
  2012-05-08 22:22 ` manu at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2012-05-08 22:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-05-08 22:14:43 UTC ---
Author: manu
Date: Tue May  8 22:14:34 2012
New Revision: 187300

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187300
Log:
2012-05-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>

    PR c++/53261
c-family/
    * c-common.c (warn_logical_operator): Check that argument of
    integer_zerop is not NULL.

Modified:
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-common.c


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

* [Bug c++/53261] [4.8 Regression] ICE in tree_strip_nop_conversions
  2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2012-05-08 22:19 ` manu at gcc dot gnu.org
@ 2012-05-08 22:22 ` manu at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: manu at gcc dot gnu.org @ 2012-05-08 22:22 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

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

--- Comment #6 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-05-08 22:18:47 UTC ---
It should be fixed now.


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

end of thread, other threads:[~2012-05-08 22:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-06 22:40 [Bug c++/53261] New: [4.8 Regression] ICE in tree_strip_nop_conversions danglin at gcc dot gnu.org
2012-05-07  9:21 ` [Bug c++/53261] " rguenth at gcc dot gnu.org
2012-05-07 11:30 ` danglin at gcc dot gnu.org
2012-05-07 15:38 ` paolo.carlini at oracle dot com
2012-05-07 16:29 ` manu at gcc dot gnu.org
2012-05-08 15:28 ` dave.anglin at bell dot net
2012-05-08 22:19 ` manu at gcc dot gnu.org
2012-05-08 22:22 ` manu 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).