public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/26264]  New: Extraneous warning with __builtin_stdarg_start and optimization
@ 2006-02-13 18:51 James dot Juran at baesystems dot com
  2006-02-13 18:54 ` [Bug tree-optimization/26264] " pinskia at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 16+ messages in thread
From: James dot Juran at baesystems dot com @ 2006-02-13 18:51 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

The testcase from PR 18828 produces the improper diagnostic

18828.c: In function ‘foo’:
18828.c:11: warning: second parameter of ‘va_start’ not last named argument

with 4.0 and above if the use of __builtin_va_start() is replaced with
__builtin_stdarg_start().  According to the ChangeLog below
__builtin_stdarg_start was renamed to __builtin_va_start, but I could find no
information about __builtin_stdarg_start() being deprecated or removed.

2002-07-15  Zack Weinberg  <zack@codesourcery.com>
        * ginclude/varargs.h: Replace with stub which issues #error.
        * ginclude/stdarg.h: __builtin_stdarg_start is renamed
        __builtin_va_start.
[...]

3.4 does not produce the extraneous warning, so something introduced it after
the renaming of __builtin_stdarg_start to __builtin_va_start.

Testcase:

typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;

extern void abort (void);

void foo (int size, ...)
{
  va_list ap;
  if (size != 21)
    abort ();
  __builtin_stdarg_start(ap,size);
  __builtin_va_end(ap);
}


-- 
           Summary: Extraneous warning with __builtin_stdarg_start and
                    optimization
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: James dot Juran at baesystems dot com


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
@ 2006-02-13 18:54 ` pinskia at gcc dot gnu dot org
  2006-02-13 18:59 ` pinskia at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-13 18:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-02-13 18:54 -------
__builtin_stdarg_start is depreciated.


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
  2006-02-13 18:54 ` [Bug tree-optimization/26264] " pinskia at gcc dot gnu dot org
@ 2006-02-13 18:59 ` pinskia at gcc dot gnu dot org
  2006-02-13 19:02 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-13 18:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-02-13 18:59 -------
This patch will fix the problem:
Index: gimplify.c
===================================================================
--- gimplify.c  (revision 110916)
+++ gimplify.c  (working copy)
@@ -1984,7 +1984,8 @@ gimplify_call_expr (tree *expr_p, tree *
        }

       if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
-         && DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START)
+         && (DECL_FUNCTION_CODE (decl) == BUILT_IN_VA_START
+             || DECL_FUNCTION_CODE (decl) == BUILT_IN_STDARG_START))
         {
          if (!arglist || !TREE_CHAIN (arglist))
            {



But I don't know why GCC still has __builtin_stdarg_start.


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
  2006-02-13 18:54 ` [Bug tree-optimization/26264] " pinskia at gcc dot gnu dot org
  2006-02-13 18:59 ` pinskia at gcc dot gnu dot org
@ 2006-02-13 19:02 ` pinskia at gcc dot gnu dot org
  2006-02-13 19:04 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-13 19:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-02-13 19:02 -------
http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00737.html
Looks like the only reason why __builtin_stdarg_start is still there is for
compatibility reasons, though it most likely should be removed.


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (2 preceding siblings ...)
  2006-02-13 19:02 ` pinskia at gcc dot gnu dot org
@ 2006-02-13 19:04 ` pinskia at gcc dot gnu dot org
  2006-02-13 19:06 ` James dot Juran at baesystems dot com
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-02-13 19:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-02-13 19:04 -------
http://gcc.gnu.org/ml/gcc-patches/2002-06/msg02203.html


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (3 preceding siblings ...)
  2006-02-13 19:04 ` pinskia at gcc dot gnu dot org
@ 2006-02-13 19:06 ` James dot Juran at baesystems dot com
  2006-02-13 19:08   ` Andrew Pinski
  2006-02-13 19:08 ` pinskia at physics dot uc dot edu
                   ` (8 subsequent siblings)
  13 siblings, 1 reply; 16+ messages in thread
From: James dot Juran at baesystems dot com @ 2006-02-13 19:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from James dot Juran at baesystems dot com  2006-02-13 19:06 -------
Yes, that does seem to be the case based on the ChangeLog I quoted.  And of
course the easy workaround for a developer is just to use __builtin_va_start
instead.  But is the deprecation of __builtin_stdarg_start documented anywhere?
 As I noted in the PR, I looked and couldn't find any mention of its
deprecation.

Thank you for the very quick patch though.  Either applying this patch or
getting rid of __builtin_stdarg_start entirely (with appropriate documentation)
would seem to be preferable to the current behavior.


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (4 preceding siblings ...)
  2006-02-13 19:06 ` James dot Juran at baesystems dot com
@ 2006-02-13 19:08 ` pinskia at physics dot uc dot edu
  2006-02-13 19:15 ` James dot Juran at baesystems dot com
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: pinskia at physics dot uc dot edu @ 2006-02-13 19:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-02-13 19:08 -------
Subject: Re:  Extraneous warning with __builtin_stdarg_start and optimization

> ------- Comment #5 from James dot Juran at baesystems dot com  2006-02-13 19:06 -------
> Yes, that does seem to be the case based on the ChangeLog I quoted.  And of
> course the easy workaround for a developer is just to use __builtin_va_start
> instead.  But is the deprecation of __builtin_stdarg_start documented anywhere?
>  As I noted in the PR, I looked and couldn't find any mention of its
> deprecation.

Why is the developer using an undocumented builtin in the first place?

-- Pinski


-- 


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


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

* Re: [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 19:06 ` James dot Juran at baesystems dot com
@ 2006-02-13 19:08   ` Andrew Pinski
  0 siblings, 0 replies; 16+ messages in thread
From: Andrew Pinski @ 2006-02-13 19:08 UTC (permalink / raw)
  To: gcc-bugzilla; +Cc: gcc-bugs

> ------- Comment #5 from James dot Juran at baesystems dot com  2006-02-13 19:06 -------
> Yes, that does seem to be the case based on the ChangeLog I quoted.  And of
> course the easy workaround for a developer is just to use __builtin_va_start
> instead.  But is the deprecation of __builtin_stdarg_start documented anywhere?
>  As I noted in the PR, I looked and couldn't find any mention of its
> deprecation.

Why is the developer using an undocumented builtin in the first place?

-- Pinski


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (5 preceding siblings ...)
  2006-02-13 19:08 ` pinskia at physics dot uc dot edu
@ 2006-02-13 19:15 ` James dot Juran at baesystems dot com
  2007-01-23 14:29 ` manu at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: James dot Juran at baesystems dot com @ 2006-02-13 19:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from James dot Juran at baesystems dot com  2006-02-13 19:15 -------
Point granted; I guess __builtin_stdarg_start could just be removed without
warning or notice.


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (6 preceding siblings ...)
  2006-02-13 19:15 ` James dot Juran at baesystems dot com
@ 2007-01-23 14:29 ` manu at gcc dot gnu dot org
  2007-01-24 17:22 ` James dot Juran at baesystems dot com
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-01-23 14:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from manu at gcc dot gnu dot org  2007-01-23 14:28 -------
What about a warning about __builtin_stdarg_start being deprecated? That will
be clearer than the current warning, and we can still keep backwards
compatibility (the user may use -Wno-deprecated to work-around the warning and
GCC will replace __builtin_stdarg_start with __builtin_va_start).

Does this seem OK?


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (7 preceding siblings ...)
  2007-01-23 14:29 ` manu at gcc dot gnu dot org
@ 2007-01-24 17:22 ` James dot Juran at baesystems dot com
  2007-10-28 23:43 ` manu at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: James dot Juran at baesystems dot com @ 2007-01-24 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from James dot Juran at baesystems dot com  2007-01-24 17:22 -------
(In reply to comment #8)
> What about a warning about __builtin_stdarg_start being deprecated? That will
> be clearer than the current warning, and we can still keep backwards
> compatibility (the user may use -Wno-deprecated to work-around the warning and
> GCC will replace __builtin_stdarg_start with __builtin_va_start).
> 
> Does this seem OK?

Marking __builtin_stdarg_start as deprecated sounds like a good idea, although
it seems it could also just be removed entirely as Andrew suggested.  If you do
keep it around as deprecated, it would seem to make sense to also apply the
patch Andrew provided to keep the strange "second parameter of 'va_start' not
last named argument" warning from happening.

I'm not a GCC developer, just a user, so please weight my opinions
appropriately :-)

James


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (8 preceding siblings ...)
  2007-01-24 17:22 ` James dot Juran at baesystems dot com
@ 2007-10-28 23:43 ` manu at gcc dot gnu dot org
  2007-11-01 22:47 ` manu at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-10-28 23:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from manu at gcc dot gnu dot org  2007-10-28 23:42 -------
I cannot reproduce the warning in trunk neither in GCC 4.1.2. I nobody can
reproduce this in a recent version, I will close it.


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (9 preceding siblings ...)
  2007-10-28 23:43 ` manu at gcc dot gnu dot org
@ 2007-11-01 22:47 ` manu at gcc dot gnu dot org
  2007-11-10  3:48 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 16+ messages in thread
From: manu at gcc dot gnu dot org @ 2007-11-01 22:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |manu at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-01 22:47:25
               date|                            |


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (10 preceding siblings ...)
  2007-11-01 22:47 ` manu at gcc dot gnu dot org
@ 2007-11-10  3:48 ` patchapp at dberlin dot org
  2008-02-26 14:17 ` manu at gcc dot gnu dot org
  2008-02-26 14:46 ` manu at gcc dot gnu dot org
  13 siblings, 0 replies; 16+ messages in thread
From: patchapp at dberlin dot org @ 2007-11-10  3:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from patchapp at dberlin dot org  2007-11-10 03:47 -------
Subject: Bug number PR middle-end/26264

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-11/msg00106.html


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (11 preceding siblings ...)
  2007-11-10  3:48 ` patchapp at dberlin dot org
@ 2008-02-26 14:17 ` manu at gcc dot gnu dot org
  2008-02-26 14:46 ` manu at gcc dot gnu dot org
  13 siblings, 0 replies; 16+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-26 14:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from manu at gcc dot gnu dot org  2008-02-26 14:17 -------
Subject: Bug 26264

Author: manu
Date: Tue Feb 26 14:16:13 2008
New Revision: 132677

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132677
Log:
2008-02-26  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>

        PR 26264
        * builtins.def (BUILT_IN_STDARG_START): Remove.
        * builtins.c (expand_builtin): Remove BUILT_IN_STDARG_START.
        * tree-stdarg.c (execute_optimize_stdarg): Likewise.
        * tree-inline.c (inline_forbidden_p_1): Likewise.
cp/
        * call.c (magic_varargs_p):  Remove BUILT_IN_STDARG_START.
testsuite/
        * 20021023-1.c: Use __builtin_va_start instead of
        __builtin_stdarg_start.
        * pr17301-1.c: Likewise.
        * pr17301-2.c: Likewise.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/builtins.c
    trunk/gcc/builtins.def
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/20021023-1.c
    trunk/gcc/testsuite/gcc.dg/pr17301-1.c
    trunk/gcc/testsuite/gcc.dg/pr17301-2.c
    trunk/gcc/tree-inline.c
    trunk/gcc/tree-stdarg.c


-- 


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


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

* [Bug tree-optimization/26264] Extraneous warning with __builtin_stdarg_start and optimization
  2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
                   ` (12 preceding siblings ...)
  2008-02-26 14:17 ` manu at gcc dot gnu dot org
@ 2008-02-26 14:46 ` manu at gcc dot gnu dot org
  13 siblings, 0 replies; 16+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-02-26 14:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from manu at gcc dot gnu dot org  2008-02-26 14:45 -------
Fixed in GCC 4.4


-- 

manu at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-02-26 14:46 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-13 18:51 [Bug tree-optimization/26264] New: Extraneous warning with __builtin_stdarg_start and optimization James dot Juran at baesystems dot com
2006-02-13 18:54 ` [Bug tree-optimization/26264] " pinskia at gcc dot gnu dot org
2006-02-13 18:59 ` pinskia at gcc dot gnu dot org
2006-02-13 19:02 ` pinskia at gcc dot gnu dot org
2006-02-13 19:04 ` pinskia at gcc dot gnu dot org
2006-02-13 19:06 ` James dot Juran at baesystems dot com
2006-02-13 19:08   ` Andrew Pinski
2006-02-13 19:08 ` pinskia at physics dot uc dot edu
2006-02-13 19:15 ` James dot Juran at baesystems dot com
2007-01-23 14:29 ` manu at gcc dot gnu dot org
2007-01-24 17:22 ` James dot Juran at baesystems dot com
2007-10-28 23:43 ` manu at gcc dot gnu dot org
2007-11-01 22:47 ` manu at gcc dot gnu dot org
2007-11-10  3:48 ` patchapp at dberlin dot org
2008-02-26 14:17 ` manu at gcc dot gnu dot org
2008-02-26 14:46 ` manu 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).