public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
@ 2012-06-01 11:45 xarthisius.kk at gmail dot com
  2012-06-01 11:54 ` [Bug tree-optimization/53550] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: xarthisius.kk at gmail dot com @ 2012-06-01 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53550
           Summary: [4.6/4.7/4.8 regression] ICE with -O{1,2,3}
                    -fprefetch-loop-arrays in build2_stat, at tree.c:3803
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: xarthisius.kk@gmail.com


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

Starting program: /dev/shm/portage/sys-devel/gcc-4.6.3/work/build/gcc/cc1 -O2
-fprefetch-loop-arrays /ice_416991.i
 wctomb mbstowcs luma_render
/ice_416991.i: In function 'luma_render':
/ice_416991.i:28:20: warning: incompatible implicit declaration of built-in
function 'malloc' [enabled by default]

Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> <visibility> <early_local_cleanups> <whole-program>
<ipa-profile> <cp> <inline> <pure-const> <static-var>Assembling functions:
 wctomb mbstowcs luma_render
Breakpoint 1, 0x00000000005ba3e4 in fancy_abort ()
(gdb) bt
#0  0x00000000005ba3e4 in fancy_abort ()
#1  0x00000000009bf92b in build2_stat ()
#2  0x000000000064370e in build2_stat_loc ()
#3  0x000000000067967c in fold_build2_stat_loc ()
#4  0x000000000091022c in determine_exit_conditions ()
#5  0x0000000000910549 in tree_transform_and_unroll_loop ()
#6  0x000000000091107c in tree_unroll_loop ()
#7  0x0000000000ddfc64 in loop_prefetch_arrays ()
#8  0x0000000000ddffc5 in tree_ssa_prefetch_arrays ()
#9  0x000000000091a47d in tree_ssa_loop_prefetch ()
#10 0x0000000000759059 in execute_one_pass ()
#11 0x0000000000759233 in execute_pass_list ()
#12 0x0000000000759254 in execute_pass_list ()
#13 0x0000000000759254 in execute_pass_list ()
#14 0x000000000088eae1 in tree_rest_of_compilation ()
#15 0x0000000000a49d0b in cgraph_expand_function ()
#16 0x0000000000a49eca in cgraph_expand_all_functions ()
#17 0x0000000000a4a533 in cgraph_optimize ()
#18 0x0000000000a48b22 in cgraph_finalize_compilation_unit ()
#19 0x000000000049de30 in c_write_global_declarations ()
#20 0x000000000083006e in compile_file ()
#21 0x0000000000832000 in do_compile ()
#22 0x0000000000832146 in toplev_main ()
#23 0x0000000000521118 in main ()

Downstream bug: https://bugs.gentoo.org/show_bug.cgi?id=416991

I've checked that it also fails with gcc-4.4.6, however it works fine with
gcc-4.5.3.


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

* [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
@ 2012-06-01 11:54 ` rguenth at gcc dot gnu.org
  2012-06-01 12:04 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-06-01 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-06-01
            Version|unknown                     |4.6.3
   Target Milestone|---                         |4.6.4
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-06-01 11:53:51 UTC ---
Confirmed.


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

* [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
  2012-06-01 11:54 ` [Bug tree-optimization/53550] " rguenth at gcc dot gnu.org
@ 2012-06-01 12:04 ` jakub at gcc dot gnu.org
  2012-06-01 12:29 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-01 12:04 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-01 12:03:40 UTC ---
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161655
(aka MEM_REF).  Guess the bug is that step's type is POINTER_TYPE, it should
probably be some integer type instead.


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

* [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
  2012-06-01 11:54 ` [Bug tree-optimization/53550] " rguenth at gcc dot gnu.org
  2012-06-01 12:04 ` jakub at gcc dot gnu.org
@ 2012-06-01 12:29 ` jakub at gcc dot gnu.org
  2012-06-01 12:40 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-01 12:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-01 12:29:11 UTC ---
I'd think
--- tree-ssa-loop-niter.c.jj    2012-05-30 14:38:55.000000000 +0200
+++ tree-ssa-loop-niter.c    2012-06-01 14:27:43.202456745 +0200
@@ -1276,13 +1276,14 @@ number_of_iterations_cond (struct loop *
      practice, but it is simple enough to manage.  */
   if (!integer_zerop (iv0->step) && !integer_zerop (iv1->step))
     {
+      tree step_type = POINTER_TYPE_P (type) ? sizetype : type;
       if (code != NE_EXPR)
     return false;

-      iv0->step = fold_binary_to_constant (MINUS_EXPR, type,
+      iv0->step = fold_binary_to_constant (MINUS_EXPR, step_type,
                        iv0->step, iv1->step);
       iv0->no_overflow = false;
-      iv1->step = build_int_cst (type, 0);
+      iv1->step = build_int_cst (step_type, 0);
       iv1->no_overflow = true;
     }
would match what tree-chrec.c is doing.


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

* [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
                   ` (2 preceding siblings ...)
  2012-06-01 12:29 ` jakub at gcc dot gnu.org
@ 2012-06-01 12:40 ` jakub at gcc dot gnu.org
  2012-06-04  9:24 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-01 12:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jakub at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-01 12:39:52 UTC ---
Created attachment 27540
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27540
gcc48-pr53550.patch

Full patch (untested).


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

* [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
                   ` (3 preceding siblings ...)
  2012-06-01 12:40 ` jakub at gcc dot gnu.org
@ 2012-06-04  9:24 ` jakub at gcc dot gnu.org
  2012-06-04  9:27 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-04  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-04 09:23:35 UTC ---
Author: jakub
Date: Mon Jun  4 09:23:27 2012
New Revision: 188169

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188169
Log:
    PR tree-optimization/53550
    * tree-ssa-loop-niter.c (number_of_iterations_cond): If type
    is POINTER_TYPE_P, use sizetype as step type instead of type.

    * gcc.dg/pr53550.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr53550.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-loop-niter.c


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

* [Bug tree-optimization/53550] [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
                   ` (4 preceding siblings ...)
  2012-06-04  9:24 ` jakub at gcc dot gnu.org
@ 2012-06-04  9:27 ` jakub at gcc dot gnu.org
  2012-06-04 10:17 ` [Bug tree-optimization/53550] [4.6 " jakub at gcc dot gnu.org
  2013-04-12 16:25 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-04  9:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-04 09:27:04 UTC ---
Author: jakub
Date: Mon Jun  4 09:27:00 2012
New Revision: 188170

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188170
Log:
    PR tree-optimization/53550
    * tree-ssa-loop-niter.c (number_of_iterations_cond): If type
    is POINTER_TYPE_P, use sizetype as step type instead of type.

    * gcc.dg/pr53550.c: New test.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/pr53550.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_7-branch/gcc/tree-ssa-loop-niter.c


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

* [Bug tree-optimization/53550] [4.6 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
                   ` (5 preceding siblings ...)
  2012-06-04  9:27 ` jakub at gcc dot gnu.org
@ 2012-06-04 10:17 ` jakub at gcc dot gnu.org
  2013-04-12 16:25 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-06-04 10:17 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.1, 4.8.0
            Summary|[4.6/4.7/4.8 regression]    |[4.6 regression] ICE with
                   |ICE with -O{1,2,3}          |-O{1,2,3}
                   |-fprefetch-loop-arrays in   |-fprefetch-loop-arrays in
                   |build2_stat, at tree.c:3803 |build2_stat, at tree.c:3803

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-06-04 10:17:22 UTC ---
Fixed for 4.7+ so far.


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

* [Bug tree-optimization/53550] [4.6 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803
  2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
                   ` (6 preceding siblings ...)
  2012-06-04 10:17 ` [Bug tree-optimization/53550] [4.6 " jakub at gcc dot gnu.org
@ 2013-04-12 16:25 ` jakub at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 16:25 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 16:25:39 UTC ---
The 4.6 branch has been closed, fixed in GCC 4.7.1.


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

end of thread, other threads:[~2013-04-12 16:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-01 11:45 [Bug tree-optimization/53550] New: [4.6/4.7/4.8 regression] ICE with -O{1,2,3} -fprefetch-loop-arrays in build2_stat, at tree.c:3803 xarthisius.kk at gmail dot com
2012-06-01 11:54 ` [Bug tree-optimization/53550] " rguenth at gcc dot gnu.org
2012-06-01 12:04 ` jakub at gcc dot gnu.org
2012-06-01 12:29 ` jakub at gcc dot gnu.org
2012-06-01 12:40 ` jakub at gcc dot gnu.org
2012-06-04  9:24 ` jakub at gcc dot gnu.org
2012-06-04  9:27 ` jakub at gcc dot gnu.org
2012-06-04 10:17 ` [Bug tree-optimization/53550] [4.6 " jakub at gcc dot gnu.org
2013-04-12 16:25 ` 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).