public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: brian@murphy.dk
To: gcc-gnats@gcc.gnu.org
Subject: c/9337: using -Wpadded on powerpc gcc-3.2 causes spurious warning on all files
Date: Thu, 16 Jan 2003 09:36:00 -0000	[thread overview]
Message-ID: <20030116092640.17128.qmail@sources.redhat.com> (raw)


>Number:         9337
>Category:       c
>Synopsis:       using -Wpadded on powerpc gcc-3.2 causes spurious warning on all files
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 16 01:36:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Brian Murphy
>Release:        gcc-3.2
>Organization:
>Environment:
powerpc cross compiler on intel
>Description:
grc.c contains:

struct {
    int a;
} A;

compiling with -Wpadded produces this warning:
$ powerpc-eabi-gcc -c -Wpadded grb.c
<built-in>:0: warning: padding struct to align `overflow_arg_area'

Version:
$ powerpc-eabi-gcc -v
Reading specs from
/usr/local/compilers/powerpc-eabi/v1/lib/gcc-lib/powerpc-eabi/3.2/specs
Configured with: ../gcc-3.2/configure --target=powerpc-eabi
--prefix=/usr/local/compilers/powerpc-eabi/v1 --with-newlib
--enable-languages=c,c++ --with-gnu-ld --with-gnu-as --disable-shared
Thread model: single
gcc version 3.2
>How-To-Repeat:

>Fix:
This patch fixes the problem for us(contact me if it gets mangled):

--- gcc/config/rs6000/rs6000.c	Thu Aug  8 16:51:47 2002
+++ gcc/config/rs6000/rs6000.c	Wed Jan 15 14:41:27 2003
@@ -2988,7 +2988,7 @@
 tree
 rs6000_build_va_list ()
 {
-  tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
+  tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl, f_dummy;
 
   /* For AIX, prefer 'char *' because that's what the system
      header files like.  */
@@ -3002,6 +3002,8 @@
 		      unsigned_char_type_node);
   f_fpr = build_decl (FIELD_DECL, get_identifier ("fpr"), 
 		      unsigned_char_type_node);
+  f_dummy = build_decl (FIELD_DECL, get_identifier ("dummy"), 
+		      short_integer_type_node);
   f_ovf = build_decl (FIELD_DECL, get_identifier ("overflow_arg_area"),
 		      ptr_type_node);
   f_sav = build_decl (FIELD_DECL, get_identifier ("reg_save_area"),
@@ -3009,6 +3011,7 @@
 
   DECL_FIELD_CONTEXT (f_gpr) = record;
   DECL_FIELD_CONTEXT (f_fpr) = record;
+  DECL_FIELD_CONTEXT (f_dummy) = record;
   DECL_FIELD_CONTEXT (f_ovf) = record;
   DECL_FIELD_CONTEXT (f_sav) = record;
 
@@ -3016,7 +3019,8 @@
   TYPE_NAME (record) = type_decl;
   TYPE_FIELDS (record) = f_gpr;
   TREE_CHAIN (f_gpr) = f_fpr;
-  TREE_CHAIN (f_fpr) = f_ovf;
+  TREE_CHAIN (f_fpr) = f_dummy;
+  TREE_CHAIN (f_dummy) = f_ovf;
   TREE_CHAIN (f_ovf) = f_sav;
 
   layout_type (record);
@@ -3034,7 +3038,7 @@
      rtx nextarg;
 {
   HOST_WIDE_INT words, n_gpr, n_fpr;
-  tree f_gpr, f_fpr, f_ovf, f_sav;
+  tree f_gpr, f_fpr, f_ovf, f_sav, f_dummy;
   tree gpr, fpr, ovf, sav, t;
 
   /* Only SVR4 needs something special.  */
@@ -3046,7 +3050,8 @@
 
   f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
   f_fpr = TREE_CHAIN (f_gpr);
-  f_ovf = TREE_CHAIN (f_fpr);
+  f_dummy = TREE_CHAIN (f_fpr);
+  f_ovf = TREE_CHAIN (f_dummy);
   f_sav = TREE_CHAIN (f_ovf);
 
   valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist);
@@ -3103,7 +3108,7 @@
 rs6000_va_arg (valist, type)
      tree valist, type;
 {
-  tree f_gpr, f_fpr, f_ovf, f_sav;
+  tree f_gpr, f_fpr, f_ovf, f_sav, f_dummy;
   tree gpr, fpr, ovf, sav, reg, t, u;
   int indirect_p, size, rsize, n_reg, sav_ofs, sav_scale;
   rtx lab_false, lab_over, addr_rtx, r;
@@ -3118,7 +3123,8 @@
 
   f_gpr = TYPE_FIELDS (TREE_TYPE (va_list_type_node));
   f_fpr = TREE_CHAIN (f_gpr);
-  f_ovf = TREE_CHAIN (f_fpr);
+  f_dummy = TREE_CHAIN (f_fpr);
+  f_ovf = TREE_CHAIN (f_dummy);
   f_sav = TREE_CHAIN (f_ovf);
 
   valist = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (valist)), valist);
>Release-Note:
>Audit-Trail:
>Unformatted:


                 reply	other threads:[~2003-01-16  9:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030116092640.17128.qmail@sources.redhat.com \
    --to=brian@murphy.dk \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).