[Bug c/96270] [8/9/10/11 Regression] stdarg malfunction with -m32 and -Os

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 21 16:55:04 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96270

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-07-21
                 CC|                            |jakub at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|stdarg malfunction with     |[8/9/10/11 Regression]
                   |-m32 and -Os                |stdarg malfunction with
                   |                            |-m32 and -Os
   Target Milestone|---                         |8.5
             Status|UNCONFIRMED                 |NEW

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Changed with r241329.
And the difference between that and the previous revision is
@@ -26,25 +26,25 @@ f2 (struct val * p)
 {
   unsigned char _1;
   unsigned char _8;
-  long long int pretmp_11;
-  double _12;
+  double pretmp_11;
+  long long int _12;

   <bb 2>:
   _1 = p_6(D)->type;
   _8 = _1 & 1;
-  pretmp_11 = p_6(D)->u.i;
+  pretmp_11 = p_6(D)->u.r;
   if (_8 != 0)
     goto <bb 3>;
   else
     goto <bb 4>;

   <bb 3>:
-  f1 ("1", pretmp_11); [tail call]
+  _12 = VIEW_CONVERT_EXPR<long long int>(pretmp_11);
+  f1 ("1", _12); [tail call]
   goto <bb 5>;

   <bb 4>:
-  _12 = VIEW_CONVERT_EXPR<double>(pretmp_11);
-  f1 ("3", _12); [tail call]
+  f1 ("3", pretmp_11); [tail call]

   <bb 5>:
   return;

Using a floating point type to hold the pretmp when it also contains
non-floating point values (or other floating point types) looks wrong.


More information about the Gcc-bugs mailing list