------- Comment #2 from jakub at gcc dot gnu dot org  2008-04-23 10:45 -------
Caused I believe by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124835
likely together with http://gcc.gnu.org/ml/gcc-patches/2007-03/msg01511.html
While in 4.2 functions with fntype without TYPE_ARG_TYPES (i.e. !prototype_p)
nregs, etc. would be preserved and maybe_vaarg set to true only afterwards,
in 4.3 it is set early and the calling convention is forced to stack.

maybe_vaarg is only used in 2 places - in init_cumulative_args itself, in
!TARGET_64BIT case only, and in function_arg_64 (i.e. TARGET_64BIT case only).
If we want to restore 4.2 and earlier behavior (I think we have to), then
one fix could be e.g. only set maybe_vaarg to true for !prototype_p (fntype)
if TARGET_64BIT.
-                      ? (!prototype_p (fntype) || stdarg_p (fntype))
+                      ? ((TARGET_64BIT && !prototype_p (fntype))
+                         || stdarg_p (fntype))

As K&R fn declaration (i.e. !prototype_p) followed by stdarg_p definition or
prototype is diagnosed as an error by diagnose_arglist_conflict, I believe this
is safe.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com, hubicka at gcc dot gnu
                   |                            |dot org


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

Reply via email to