This is the mail archive of the
mailing list for the GCC project.
[PATCH] [COMMITTED 3.4/3.5] Maybe Fix Java Bootstrap on powerpc
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Andrew Pinski <pinskia at physics dot uc dot edu>, Andreas Tobler <toa at pop dot agri dot ch>
- Date: Sun, 18 Jan 2004 07:45:01 -0800
- Subject: [PATCH] [COMMITTED 3.4/3.5] Maybe Fix Java Bootstrap on powerpc
I did not expect NULLs in the field's chain, I had only built with C,
C++, Objc, and f77.
This patch fixes that by checking for NULL and making sure that it does
not seg fault.
Committed to the mainline and 3.4 branch as obvious.
* config/rs6000/rs6000.c (rs6000_special_round_type_align):
Check for NULL in the chain and remove repeated code.
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.579
diff -u -p -r1.579 rs6000.c
--- rs6000.c 18 Jan 2004 03:46:55 -0000 1.579
+++ rs6000.c 18 Jan 2004 15:42:56 -0000
@@ -2325,15 +2325,13 @@ unsigned int
rs6000_special_round_type_align (tree type, int computed, int
tree field = TYPE_FIELDS (type);
- if (!field)
- return MAX (computed, specified);
/* Skip all the static variables only if ABI is greater than
1 or equal to 0. */
- while (TREE_CODE (field) == VAR_DECL)
+ while (field != NULL && TREE_CODE (field) == VAR_DECL)
field = TREE_CHAIN (field);
- if (field == type || DECL_MODE (field) != DFmode)
+ if (field == NULL || field == type || DECL_MODE (field) != DFmode)
return MAX (computed, specified);
return MAX (MAX (computed, specified), 64);