public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro  `DF_REG_SIZE' used without args
@ 2007-08-17 16:32 Kaveh R. GHAZI
  2007-08-17 17:10 ` Zdenek Dvorak
  2007-08-17 18:12 ` Andrew Pinski
  0 siblings, 2 replies; 5+ messages in thread
From: Kaveh R. GHAZI @ 2007-08-17 16:32 UTC (permalink / raw)
  To: gcc-patches

I had to use a gcc-2.8.1 binary that came with gnat on solaris to try out
bootstrapping ada.  When bootstrapping mainline, it complains about this
in stage1:

	loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
	make[2]: *** [loop-invariant.o] Error 1

The argument to the macro DF_REG_SIZE is a placebo, it's never used.
Nevertheless all other uses of it pass in 'df' so I did it here also. This
regression appeared to have been installed during the dataflow branch
merge:
http://gcc.gnu.org/viewcvs/trunk/gcc/loop-invariant.c?r1=124639&r2=125624
Therefore older release branches are not affected, only mainline needs a
fix.

Patch below allows bootstrap of mainline to proceed using gcc-2.8.1.

Okay for the trunk?

		Thanks,
		--Kaveh


2007-08-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* loop-invariant.c (find_invariants_to_move): Add missing macro
	argument.

diff -rup orig/egcc-SVN20070817/gcc/loop-invariant.c egcc-SVN20070817/gcc/loop-invariant.c
--- orig/egcc-SVN20070817/gcc/loop-invariant.c	2007-07-26 23:04:01.000000000 -0400
+++ egcc-SVN20070817/gcc/loop-invariant.c	2007-08-17 12:22:35.193662226 -0400
@@ -1123,7 +1123,7 @@ find_invariants_to_move (void)
 {
   unsigned i, regs_used, regs_needed = 0, new_regs;
   struct invariant *inv = NULL;
-  unsigned int n_regs = DF_REG_SIZE ();
+  unsigned int n_regs = DF_REG_SIZE (df);

   if (!VEC_length (invariant_p, invariants))
     return;

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

* Re: [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro  `DF_REG_SIZE' used without args
  2007-08-17 16:32 [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro `DF_REG_SIZE' used without args Kaveh R. GHAZI
@ 2007-08-17 17:10 ` Zdenek Dvorak
  2007-08-17 18:12 ` Andrew Pinski
  1 sibling, 0 replies; 5+ messages in thread
From: Zdenek Dvorak @ 2007-08-17 17:10 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: gcc-patches

Hello,

> I had to use a gcc-2.8.1 binary that came with gnat on solaris to try out
> bootstrapping ada.  When bootstrapping mainline, it complains about this
> in stage1:
> 
> 	loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
> 	make[2]: *** [loop-invariant.o] Error 1
> 
> The argument to the macro DF_REG_SIZE is a placebo, it's never used.
> Nevertheless all other uses of it pass in 'df' so I did it here also. This
> regression appeared to have been installed during the dataflow branch
> merge:
> http://gcc.gnu.org/viewcvs/trunk/gcc/loop-invariant.c?r1=124639&r2=125624
> Therefore older release branches are not affected, only mainline needs a
> fix.
> 
> Patch below allows bootstrap of mainline to proceed using gcc-2.8.1.
> 
> Okay for the trunk?

OK.

Zdenek

> 		Thanks,
> 		--Kaveh
> 
> 
> 2007-08-17  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
> 
> 	* loop-invariant.c (find_invariants_to_move): Add missing macro
> 	argument.
> 
> diff -rup orig/egcc-SVN20070817/gcc/loop-invariant.c egcc-SVN20070817/gcc/loop-invariant.c
> --- orig/egcc-SVN20070817/gcc/loop-invariant.c	2007-07-26 23:04:01.000000000 -0400
> +++ egcc-SVN20070817/gcc/loop-invariant.c	2007-08-17 12:22:35.193662226 -0400
> @@ -1123,7 +1123,7 @@ find_invariants_to_move (void)
>  {
>    unsigned i, regs_used, regs_needed = 0, new_regs;
>    struct invariant *inv = NULL;
> -  unsigned int n_regs = DF_REG_SIZE ();
> +  unsigned int n_regs = DF_REG_SIZE (df);
> 
>    if (!VEC_length (invariant_p, invariants))
>      return;

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

* Re: [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
  2007-08-17 16:32 [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro `DF_REG_SIZE' used without args Kaveh R. GHAZI
  2007-08-17 17:10 ` Zdenek Dvorak
@ 2007-08-17 18:12 ` Andrew Pinski
  2007-08-17 18:25   ` Joseph S. Myers
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Pinski @ 2007-08-17 18:12 UTC (permalink / raw)
  To: Kaveh R. GHAZI; +Cc: gcc-patches

On 8/17/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> I had to use a gcc-2.8.1 binary that came with gnat on solaris to try out
> bootstrapping ada.  When bootstrapping mainline, it complains about this
> in stage1:
>
>         loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
>         make[2]: *** [loop-invariant.o] Error 1

Just a quick note.  This is only undefined behavior at compile time.
http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_003.html#Question3

-- Pinski

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

* Re: [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro  `DF_REG_SIZE' used without args
  2007-08-17 18:12 ` Andrew Pinski
@ 2007-08-17 18:25   ` Joseph S. Myers
  2007-08-17 18:47     ` Kaveh R. GHAZI
  0 siblings, 1 reply; 5+ messages in thread
From: Joseph S. Myers @ 2007-08-17 18:25 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: Kaveh R. GHAZI, gcc-patches

On Fri, 17 Aug 2007, Andrew Pinski wrote:

> On 8/17/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > I had to use a gcc-2.8.1 binary that came with gnat on solaris to try out
> > bootstrapping ada.  When bootstrapping mainline, it complains about this
> > in stage1:
> >
> >         loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
> >         make[2]: *** [loop-invariant.o] Error 1
> 
> Just a quick note.  This is only undefined behavior at compile time.
> http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_003.html#Question3

Empty macro arguments were undefined in C90, but are allowed in C99; the 
DR relevant in C99 context is 
<http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_259.htm>.

I don't know if we need to avoid empty arguments altogether in GCC or 
whether there is a safe subset of them (implemented in practice by C90 
compilers) we can use.

-- 
Joseph S. Myers
joseph@codesourcery.com

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

* Re: [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro   `DF_REG_SIZE' used without args
  2007-08-17 18:25   ` Joseph S. Myers
@ 2007-08-17 18:47     ` Kaveh R. GHAZI
  0 siblings, 0 replies; 5+ messages in thread
From: Kaveh R. GHAZI @ 2007-08-17 18:47 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Andrew Pinski, gcc-patches

On Fri, 17 Aug 2007, Joseph S. Myers wrote:

> On Fri, 17 Aug 2007, Andrew Pinski wrote:
>
> > On 8/17/07, Kaveh R. GHAZI <ghazi@caip.rutgers.edu> wrote:
> > > I had to use a gcc-2.8.1 binary that came with gnat on solaris to try out
> > > bootstrapping ada.  When bootstrapping mainline, it complains about this
> > > in stage1:
> > >
> > >         loop-invariant.c:1126: macro `DF_REG_SIZE' used without args
> > >         make[2]: *** [loop-invariant.o] Error 1
> >
> > Just a quick note.  This is only undefined behavior at compile time.
> > http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_003.html#Question3
>
> Empty macro arguments were undefined in C90, but are allowed in C99; the
> DR relevant in C99 context is
> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_259.htm>.
>
> I don't know if we need to avoid empty arguments altogether in GCC or
> whether there is a safe subset of them (implemented in practice by C90
> compilers) we can use.

I don't know how you would distinguish "safe subset".  Here gcc-2.8.1 is
crashing on the most simple incarnation of empty args.  In another post, I
mentioned a more complicated case where solaris cc has a bug with empty
macro args and complex layers of macros with token concatenation.
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg01131.html

Presumably we want to support bootstrap with older gcc versions.  So IMHO
we should warn about *all* empty macro arguments, at least in C90 mode
(perhaps only with -pedantic on.)

		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu

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

end of thread, other threads:[~2007-08-17 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-17 16:32 [PATCH]: error with gcc-2.8.1, loop-invariant.c:1126: macro `DF_REG_SIZE' used without args Kaveh R. GHAZI
2007-08-17 17:10 ` Zdenek Dvorak
2007-08-17 18:12 ` Andrew Pinski
2007-08-17 18:25   ` Joseph S. Myers
2007-08-17 18:47     ` Kaveh R. GHAZI

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).