public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/44921]  New: [4.6 Regression] Failed to bootstrap
@ 2010-07-12 18:38 hjl dot tools at gmail dot com
  2010-07-12 18:46 ` [Bug bootstrap/44921] " hjl dot tools at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-07-12 18:38 UTC (permalink / raw)
  To: gcc-bugs

On Linux/ia32, revision 162085 gave:

../../src-trunk/gcc/postreload.c: In function 'reload_cse_regs':
../../src-trunk/gcc/postreload.c:1327:57: error: 'min_regno' may be used
uninitialized in this function [-Werror=uninitialized]
../../src-trunk/gcc/postreload.c:1284:7: note: 'min_regno' was declared here
cc1: all warnings being treated as errors

It may be caused by revision 162085:

http://gcc.gnu.org/ml/gcc-cvs/2010-07/msg00439.html


-- 
           Summary: [4.6 Regression] Failed to bootstrap
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl dot tools at gmail dot com


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
  2010-07-12 18:46 ` [Bug bootstrap/44921] " hjl dot tools at gmail dot com
@ 2010-07-12 18:46 ` hjl dot tools at gmail dot com
  2010-07-12 22:44 ` amylaar at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-07-12 18:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from hjl dot tools at gmail dot com  2010-07-12 18:46 -------
This patch:

Index: postreload.c
===================================================================
--- postreload.c        (revision 162085)
+++ postreload.c        (working copy)
@@ -1281,7 +1281,7 @@ move2add_use_add3_insn (rtx reg, rtx sym
   rtx src = SET_SRC (pat);
   int regno = REGNO (reg);
   int min_cost = INT_MAX;
-  int min_regno;
+  int min_regno = -1;
   bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
   int i;

@@ -1317,7 +1317,7 @@ move2add_use_add3_insn (rtx reg, rtx sym
          }
       }

-  if (min_cost < rtx_cost (src, SET, speed))
+  if (min_regno >= 0 && min_cost < rtx_cost (src, SET, speed))
     {
       rtx tem;

works for me.


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
@ 2010-07-12 18:46 ` hjl dot tools at gmail dot com
  2010-07-12 18:46 ` hjl dot tools at gmail dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-07-12 18:46 UTC (permalink / raw)
  To: gcc-bugs



-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.6.0


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
  2010-07-12 18:46 ` [Bug bootstrap/44921] " hjl dot tools at gmail dot com
  2010-07-12 18:46 ` hjl dot tools at gmail dot com
@ 2010-07-12 22:44 ` amylaar at gcc dot gnu dot org
  2010-07-12 22:54 ` amylaar at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2010-07-12 22:44 UTC (permalink / raw)
  To: gcc-bugs



-- 

amylaar at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-12 22:44:40
               date|                            |


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (2 preceding siblings ...)
  2010-07-12 22:44 ` amylaar at gcc dot gnu dot org
@ 2010-07-12 22:54 ` amylaar at gcc dot gnu dot org
  2010-07-12 23:33 ` hjl dot tools at gmail dot com
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2010-07-12 22:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from amylaar at gcc dot gnu dot org  2010-07-12 22:54 -------
(In reply to comment #1)
> This patch:
> 
> Index: postreload.c
> ===================================================================
> --- postreload.c        (revision 162085)
> +++ postreload.c        (working copy)
> @@ -1281,7 +1281,7 @@ move2add_use_add3_insn (rtx reg, rtx sym
>    rtx src = SET_SRC (pat);
>    int regno = REGNO (reg);
>    int min_cost = INT_MAX;
> -  int min_regno;
> +  int min_regno = -1;
>    bool speed = optimize_bb_for_speed_p (BLOCK_FOR_INSN (insn));
>    int i;
> 
> @@ -1317,7 +1317,7 @@ move2add_use_add3_insn (rtx reg, rtx sym
>           }
>        }
> 
> -  if (min_cost < rtx_cost (src, SET, speed))
> +  if (min_regno >= 0 && min_cost < rtx_cost (src, SET, speed))
>      {
>        rtx tem;
> 
> works for me.

The variable can not actually be used uninitalized, since min_cost is
initalized to INT_MAX, and the return type of rtx_cost is int.
So it is enough to shut up the compiler warning, no need to add an
extra test there.  I.e. the first hunk should be sufficient.


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (3 preceding siblings ...)
  2010-07-12 22:54 ` amylaar at gcc dot gnu dot org
@ 2010-07-12 23:33 ` hjl dot tools at gmail dot com
  2010-07-12 23:34 ` hjl dot tools at gmail dot com
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-07-12 23:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2010-07-12 23:33 -------
(In reply to comment #2)
> The variable can not actually be used uninitalized, since min_cost is
> initalized to INT_MAX, and the return type of rtx_cost is int.
> So it is enough to shut up the compiler warning, no need to add an
> extra test there.  I.e. the first hunk should be sufficient.
> 

Does the first chunk count as obvious?


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (4 preceding siblings ...)
  2010-07-12 23:33 ` hjl dot tools at gmail dot com
@ 2010-07-12 23:34 ` hjl dot tools at gmail dot com
  2010-07-12 23:45 ` amylaar at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl dot tools at gmail dot com @ 2010-07-12 23:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from hjl dot tools at gmail dot com  2010-07-12 23:34 -------
(In reply to comment #3)
> (In reply to comment #2)
> > The variable can not actually be used uninitalized, since min_cost is
> > initalized to INT_MAX, and the return type of rtx_cost is int.
> > So it is enough to shut up the compiler warning, no need to add an
> > extra test there.  I.e. the first hunk should be sufficient.
> > 
> 
> Does the first chunk count as obvious?

Maybe

int min_regno = 0;

is faster.



-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (5 preceding siblings ...)
  2010-07-12 23:34 ` hjl dot tools at gmail dot com
@ 2010-07-12 23:45 ` amylaar at gcc dot gnu dot org
  2010-07-13  0:52 ` hjl at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: amylaar at gcc dot gnu dot org @ 2010-07-12 23:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from amylaar at gcc dot gnu dot org  2010-07-12 23:45 -------
(In reply to comment #3)
> Does the first chunk count as obvious?

I'd say yes.

My boostraps using that hunk with and without --enable-build-with-cxx on
i686-pc-linux-gnu
have progressed past the stage2/stage3 comparison.

(In reply to comment #4)

> int min_regno = 0;
> 
> is faster.

Yes, it's a cheaper constant on a number of processors in term of
size and speed.

If we really care about compiler run-time efficiency here (and efficiency
for programs that use the same warning regime), we should introduce an
attribute to tell the compiler to treat a variable as initialized even if
it isn't, so that attribute can be used in these cases of the variable
always being assigned before used even if no proof exists inside the rule
system of the compiler.


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (6 preceding siblings ...)
  2010-07-12 23:45 ` amylaar at gcc dot gnu dot org
@ 2010-07-13  0:52 ` hjl at gcc dot gnu dot org
  2010-07-13  9:51 ` jiez at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: hjl at gcc dot gnu dot org @ 2010-07-13  0:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from hjl at gcc dot gnu dot org  2010-07-13 00:52 -------
Subject: Bug 44921

Author: hjl
Date: Tue Jul 13 00:51:43 2010
New Revision: 162120

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162120
Log:
Silence gcc warning on min_regno.

2010-07-12  H.J. Lu  <hongjiu.lu@intel.com>

        PR bootstrap/44921
        * postreload.c (move2add_use_add3_insn): Silence gcc warning
        on min_regno.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/postreload.c


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (7 preceding siblings ...)
  2010-07-13  0:52 ` hjl at gcc dot gnu dot org
@ 2010-07-13  9:51 ` jiez at gcc dot gnu dot org
  2010-07-13  9:52 ` jiez at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-13  9:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from amylaar at spamcop dot net  2010-07-13 01:55 -------
Subject: Re:  [4.6 Regression] Failed to bootstrap

Quoting hjl dot tools at gmail dot com <gcc-bugzilla@gcc.gnu.org>:
> Maybe
>
> int min_regno = 0;
>
> is faster.

Considering performance, your first patch was better - it avoids a call to
rtx_cost when no optimization can be performed.  OTOH with the expensive
loop through all hard registers that's in the noise.
Or compared to the cycles wasted on failed bootstraps or this discussion ;-)


------- Comment #8 from jiez at gcc dot gnu dot org  2010-07-13 09:51 -------
Created an attachment (id=21189)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21189&action=view)
The test case

The test case


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (8 preceding siblings ...)
  2010-07-13  9:51 ` jiez at gcc dot gnu dot org
@ 2010-07-13  9:52 ` jiez at gcc dot gnu dot org
  2010-07-13 16:20 ` jiez at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-13  9:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jiez at gcc dot gnu dot org  2010-07-13 09:52 -------
I think this one caused it:

http://gcc.gnu.org/ml/gcc-patches/2010-06/msg03103.html

The test case is attached.

$ ./cc1 -O2 -Wall testcase.i -quiet
testcase.i: In function 'reload_cse_regs':
testcase.i:18129:64: warning: 'min_regno' may be used uninitialized in this
function [-Wuninitialized]
testcase.i:18095:7: note: 'min_regno' was declared here


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (9 preceding siblings ...)
  2010-07-13  9:52 ` jiez at gcc dot gnu dot org
@ 2010-07-13 16:20 ` jiez at gcc dot gnu dot org
  2010-07-13 16:40 ` jiez at gcc dot gnu dot org
  2010-07-23 12:37 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-13 16:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jiez at gcc dot gnu dot org  2010-07-13 16:20 -------
Created an attachment (id=21191)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21191&action=view)
The reduced test case


-- 


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (10 preceding siblings ...)
  2010-07-13 16:20 ` jiez at gcc dot gnu dot org
@ 2010-07-13 16:40 ` jiez at gcc dot gnu dot org
  2010-07-23 12:37 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-07-13 16:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jiez at gcc dot gnu dot org  2010-07-13 16:40 -------
Created an attachment (id=21192)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21192&action=view)
The reduced test case


-- 

jiez at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #21191|0                           |1
        is obsolete|                            |


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


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

* [Bug bootstrap/44921] [4.6 Regression] Failed to bootstrap
  2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
                   ` (11 preceding siblings ...)
  2010-07-13 16:40 ` jiez at gcc dot gnu dot org
@ 2010-07-23 12:37 ` rguenth at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-23 12:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from rguenth at gcc dot gnu dot org  2010-07-23 12:37 -------
This bug is no longer about bootstrap failure.  Which is fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2010-07-23 12:37 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-12 18:38 [Bug bootstrap/44921] New: [4.6 Regression] Failed to bootstrap hjl dot tools at gmail dot com
2010-07-12 18:46 ` [Bug bootstrap/44921] " hjl dot tools at gmail dot com
2010-07-12 18:46 ` hjl dot tools at gmail dot com
2010-07-12 22:44 ` amylaar at gcc dot gnu dot org
2010-07-12 22:54 ` amylaar at gcc dot gnu dot org
2010-07-12 23:33 ` hjl dot tools at gmail dot com
2010-07-12 23:34 ` hjl dot tools at gmail dot com
2010-07-12 23:45 ` amylaar at gcc dot gnu dot org
2010-07-13  0:52 ` hjl at gcc dot gnu dot org
2010-07-13  9:51 ` jiez at gcc dot gnu dot org
2010-07-13  9:52 ` jiez at gcc dot gnu dot org
2010-07-13 16:20 ` jiez at gcc dot gnu dot org
2010-07-13 16:40 ` jiez at gcc dot gnu dot org
2010-07-23 12:37 ` rguenth at gcc dot gnu dot 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).