public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c
@ 2006-03-14 14:25 gcc-bugzilla at gcc dot gnu dot org
2006-03-14 14:29 ` [Bug bootstrap/26679] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 12+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2006-03-14 14:25 UTC (permalink / raw)
To: gcc-bugs
During bootstrap line 3072 of varasm.c generates a warning that
shift >= width of type, and the build dies due to -Werror.
This diagnosis is correct but the shift is unreachable.
Environment:
System: Linux dps 2.6.15 #2 PREEMPT Sat Jan 7 17:47:27 GMT 2006 i686 GNU/Linux
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc/configure --prefix=/usr --enable-shared
--cache-file=config.cache
How-To-Repeat:
bootstrap with HOST_WIDE_INT intendical to unsinged int (e.g.
almost any 32 bit x86 box).
------- Comment #1 from dps at simpson dot demon dot co dot uk 2006-03-14 14:24 -------
Fix:
This patch uses reprocessor logic to elinminate the (harmless,
without -Werrror, warning.
--- gcc/varasm.c.dist 2006-03-08 11:53:25.000000000 +0000
+++ gcc/varasm.c 2006-03-14 14:12:15.000000000 +0000
@@ -3067,11 +3067,16 @@
int i;
h ^= (hashval_t) hwi;
+#if HOST_BITS_PER_WIDE_INT != SIZEOF_UNSIGNED_INT * CHAR_BIT
+ /* Leaving this in emits a warning, so stop compilation, if n=1 */
for (i = 1; i < n; ++i)
{
hwi >>= shift;
h ^= (hashval_t) hwi;
}
+#else
+ i=shift; i=n; /* Squash compiler warnings */
+#endif
}
break;
--- gcc/configure.ac.dist 2006-03-08 11:53:25.000000000 +0000
+++ gcc/configure.ac 2006-03-14 02:37:17.000000000 +0000
@@ -289,6 +289,7 @@
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(unsigned int)
AC_CHECK_SIZEOF(long)
AC_CHECK_TYPES([long long], [AC_CHECK_SIZEOF(long long)])
AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
--- gcc/config.in.dist 2006-03-08 11:53:25.000000000 +0000
+++ gcc/config.in 2006-03-14 02:41:09.000000000 +0000
@@ -1240,6 +1240,11 @@
#undef SIZEOF_INT
#endif
+/* The size of a `usigned int` as computed by sizeof. */
+#ifndef USED_FOR_TARGET
+#undef SIZEOF_UNSIGNED_INT
+#endif
+
/* The size of a `long', as computed by sizeof. */
#ifndef USED_FOR_TARGET
--
Summary: boostrap failure due to warning in gcc/varasm.c
Product: gcc
Version: 2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dps at simpson dot demon dot co dot uk
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug bootstrap/26679] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
@ 2006-03-14 14:29 ` pinskia at gcc dot gnu dot org
2006-03-14 14:31 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-14 14:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-03-14 14:29 -------
What compiler are you using to get that warning?
There should be no warning as shift is a variable and n is a variable and
should be zero.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Version|2.0 |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug bootstrap/26679] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
2006-03-14 14:29 ` [Bug bootstrap/26679] " pinskia at gcc dot gnu dot org
@ 2006-03-14 14:31 ` pinskia at gcc dot gnu dot org
2006-03-14 15:11 ` joseph at codesourcery dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-14 14:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2006-03-14 14:31 -------
And I don't see why you using SIZEOF_UNSIGNED_INT as unsigned int does not come
in anywhere.
Now hashval_t does but that could be anything.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug bootstrap/26679] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
2006-03-14 14:29 ` [Bug bootstrap/26679] " pinskia at gcc dot gnu dot org
2006-03-14 14:31 ` pinskia at gcc dot gnu dot org
@ 2006-03-14 15:11 ` joseph at codesourcery dot com
2006-03-14 18:55 ` Graham Stott
2006-03-14 15:24 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 1 reply; 12+ messages in thread
From: joseph at codesourcery dot com @ 2006-03-14 15:11 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from joseph at codesourcery dot com 2006-03-14 15:11 -------
Subject: Re: boostrap failure due to warning in
gcc/varasm.c
On Tue, 14 Mar 2006, pinskia at gcc dot gnu dot org wrote:
> What compiler are you using to get that warning?
> There should be no warning as shift is a variable and n is a variable and
> should be zero.
shift is a const variable initialized with a constant, so when building
with optimization (this is the stage1 compiler building the stage2
compiler) it gets replaced by its value. Because the warning is given
before dead code elimination, the fact that n is also a constant and the
code is unreachable is irrelevant. Why this error is newly appeared I'm
not sure.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug bootstrap/26679] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-03-14 15:11 ` joseph at codesourcery dot com
@ 2006-03-14 15:24 ` pinskia at gcc dot gnu dot org
2006-03-14 15:24 ` [Bug middle-end/26679] [4.2 Regression] " pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-14 15:24 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-03-14 15:24:03
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26679] [4.2 Regression] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-03-14 15:24 ` pinskia at gcc dot gnu dot org
@ 2006-03-14 15:24 ` pinskia at gcc dot gnu dot org
2006-03-14 15:27 ` pinskia at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-14 15:24 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|bootstrap |middle-end
Keywords| |build
Summary|boostrap failure due to |[4.2 Regression] boostrap
|warning in gcc/varasm.c |failure due to warning in
| |gcc/varasm.c
Target Milestone|--- |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26679] [4.2 Regression] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
` (4 preceding siblings ...)
2006-03-14 15:24 ` [Bug middle-end/26679] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-03-14 15:27 ` pinskia at gcc dot gnu dot org
2006-03-14 18:56 ` graham dot stott at btinternet dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-14 15:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from pinskia at gcc dot gnu dot org 2006-03-14 15:27 -------
Actually can you try it again after:
2006-03-14 Richard Guenther <rguenther@suse.de>
* configure: Regenerate with autoconf 2.13.
I think the toplevel configure was exposing this.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |WAITING
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bug bootstrap/26679] boostrap failure due to warning in gcc/varasm.c
2006-03-14 15:11 ` joseph at codesourcery dot com
@ 2006-03-14 18:55 ` Graham Stott
2006-03-14 18:57 ` Andrew Pinski
0 siblings, 1 reply; 12+ messages in thread
From: Graham Stott @ 2006-03-14 18:55 UTC (permalink / raw)
To: gcc-bugzilla, gcc-bugs
All,
If the warning isn't bogus then we probably need to do the shift in two steps
(i.e. hwi = (hwi >> (shift - 1)) >> 1) as done elsewhere to avoid the
potential warning.
--- joseph at codesourcery dot com <gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #4 from joseph at codesourcery dot com 2006-03-14 15:11
> -------
> Subject: Re: boostrap failure due to warning in
> gcc/varasm.c
>
> On Tue, 14 Mar 2006, pinskia at gcc dot gnu dot org wrote:
>
> > What compiler are you using to get that warning?
> > There should be no warning as shift is a variable and n is a variable and
> > should be zero.
>
> shift is a const variable initialized with a constant, so when building
> with optimization (this is the stage1 compiler building the stage2
> compiler) it gets replaced by its value. Because the warning is given
> before dead code elimination, the fact that n is also a constant and the
> code is unreachable is irrelevant. Why this error is newly appeared I'm
> not sure.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
>
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26679] [4.2 Regression] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
` (5 preceding siblings ...)
2006-03-14 15:27 ` pinskia at gcc dot gnu dot org
@ 2006-03-14 18:56 ` graham dot stott at btinternet dot com
2006-03-14 18:57 ` pinskia at physics dot uc dot edu
2006-03-15 13:13 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 12+ messages in thread
From: graham dot stott at btinternet dot com @ 2006-03-14 18:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from graham dot stott at btinternet dot com 2006-03-14 18:55 -------
Subject: Re: boostrap failure due to warning in gcc/varasm.c
All,
If the warning isn't bogus then we probably need to do the shift in two steps
(i.e. hwi = (hwi >> (shift - 1)) >> 1) as done elsewhere to avoid the
potential warning.
--- joseph at codesourcery dot com <gcc-bugzilla@gcc.gnu.org> wrote:
>
>
> ------- Comment #4 from joseph at codesourcery dot com 2006-03-14 15:11
> -------
> Subject: Re: boostrap failure due to warning in
> gcc/varasm.c
>
> On Tue, 14 Mar 2006, pinskia at gcc dot gnu dot org wrote:
>
> > What compiler are you using to get that warning?
> > There should be no warning as shift is a variable and n is a variable and
> > should be zero.
>
> shift is a const variable initialized with a constant, so when building
> with optimization (this is the stage1 compiler building the stage2
> compiler) it gets replaced by its value. Because the warning is given
> before dead code elimination, the fact that n is also a constant and the
> code is unreachable is irrelevant. Why this error is newly appeared I'm
> not sure.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
>
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26679] [4.2 Regression] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
` (6 preceding siblings ...)
2006-03-14 18:56 ` graham dot stott at btinternet dot com
@ 2006-03-14 18:57 ` pinskia at physics dot uc dot edu
2006-03-15 13:13 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at physics dot uc dot edu @ 2006-03-14 18:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from pinskia at gcc dot gnu dot org 2006-03-14 18:57 -------
Subject: Re: boostrap failure due to warning in gcc/varasm.c
On Mar 14, 2006, at 1:55 PM, Graham Stott wrote:
> All,
>
> If the warning isn't bogus then we probably need to do the shift in
> two steps
> (i.e. hwi = (hwi >> (shift - 1)) >> 1) as done elsewhere to avoid the
> potential warning.
The only reason why it is bogus is because well it is dead code :).
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bug bootstrap/26679] boostrap failure due to warning in gcc/varasm.c
2006-03-14 18:55 ` Graham Stott
@ 2006-03-14 18:57 ` Andrew Pinski
0 siblings, 0 replies; 12+ messages in thread
From: Andrew Pinski @ 2006-03-14 18:57 UTC (permalink / raw)
To: Graham Stott; +Cc: gcc-bugs, gcc-bugzilla
On Mar 14, 2006, at 1:55 PM, Graham Stott wrote:
> All,
>
> If the warning isn't bogus then we probably need to do the shift in
> two steps
> (i.e. hwi = (hwi >> (shift - 1)) >> 1) as done elsewhere to avoid the
> potential warning.
The only reason why it is bogus is because well it is dead code :).
-- Pinski
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug middle-end/26679] [4.2 Regression] boostrap failure due to warning in gcc/varasm.c
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
` (7 preceding siblings ...)
2006-03-14 18:57 ` pinskia at physics dot uc dot edu
@ 2006-03-15 13:13 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-15 13:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from pinskia at gcc dot gnu dot org 2006-03-15 13:13 -------
Fixed by:
2006-03-14 Richard Guenther <rguenther@suse.de>
* configure: Regenerate with autoconf 2.13.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26679
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-03-15 13:13 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-14 14:25 [Bug bootstrap/26679] New: boostrap failure due to warning in gcc/varasm.c gcc-bugzilla at gcc dot gnu dot org
2006-03-14 14:29 ` [Bug bootstrap/26679] " pinskia at gcc dot gnu dot org
2006-03-14 14:31 ` pinskia at gcc dot gnu dot org
2006-03-14 15:11 ` joseph at codesourcery dot com
2006-03-14 18:55 ` Graham Stott
2006-03-14 18:57 ` Andrew Pinski
2006-03-14 15:24 ` pinskia at gcc dot gnu dot org
2006-03-14 15:24 ` [Bug middle-end/26679] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-03-14 15:27 ` pinskia at gcc dot gnu dot org
2006-03-14 18:56 ` graham dot stott at btinternet dot com
2006-03-14 18:57 ` pinskia at physics dot uc dot edu
2006-03-15 13:13 ` pinskia 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).