[Bug middle-end/54068] Compiler passes wrong argument to function when using optimize attribute with -O3

2021-08-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54068

Andrew Pinski  changed:

   What|Removed |Added

 Resolution|--- |DUPLICATE
 Status|NEW |RESOLVED

--- Comment #3 from Andrew Pinski  ---
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6619)  
/* Caller and callee must agree on the calling convention, so
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6620)
 checking here just optimize means that with
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6621)
 __attribute__((optimize (...))) caller could use regparm convention
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6622)
 and callee not, or vice versa.  Instead look at whether the callee
251901a027bf (Jakub Jelinek2014-02-06 11:54:20 +0100  6623)
 is optimized or not.  */

So dup of bug 60062.

*** This bug has been marked as a duplicate of bug 60062 ***

[Bug middle-end/54068] Compiler passes wrong argument to function when using optimize attribute with -O3

2012-07-23 Thread steven at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54068

Steven Bosscher  changed:

   What|Removed |Added

 CC||steven at gcc dot gnu.org

--- Comment #2 from Steven Bosscher  2012-07-23 
10:17:07 UTC ---
(In reply to comment #1)
> I suppose this is the known issue with tail-call optimization which
> may get upset if you have parts compiled with -O0 and parts with -O3.

If this is a known issue, then I'd expect there is already a PR for this...?


[Bug middle-end/54068] Compiler passes wrong argument to function when using optimize attribute with -O3

2012-07-23 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54068

Richard Guenther  changed:

   What|Removed |Added

 Target||i?86-*-*
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2012-07-23
 CC||hubicka at gcc dot gnu.org
 Ever Confirmed|0   |1
  Known to fail||4.4.7, 4.5.4, 4.6.3, 4.7.1,
   ||4.8.0

--- Comment #1 from Richard Guenther  2012-07-23 
08:25:58 UTC ---
Confirmed.  Note that I would not expect

void myfn (int a, int b) __attribute__((optimize("-O3")));

to work reliably.  Attribute optimize is supposed to be used for debugging
only.  C testcase, compile with -O0 -m32:

extern void abort (void);
void myfn (int a, int b) __attribute__((optimize("-O3")));
static inline void showme (int b)
{
   if (b != 12)
 abort ();
}
void myfn (int a, int b)
{
   showme (b);
}
int main ()
{
   myfn (5, 12);
   return 0;
}

I suppose this is the known issue with tail-call optimization which
may get upset if you have parts compiled with -O0 and parts with -O3.


[Bug middle-end/54068] Compiler passes wrong argument to function when using optimize attribute with -O3

2012-07-22 Thread pinskia at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54068

Andrew Pinski  changed:

   What|Removed |Added

  Component|c   |middle-end
Summary|Compiler passes wrong   |Compiler passes wrong
   |argument to function when   |argument to function when
   |using -O3 and inline|using optimize attribute
   ||with  -O3
   Severity|major   |normal