[PATCH] [COMMITTED 3.4/3.5] Maybe Fix Java Bootstrap on powerpc
Andrew Pinski
pinskia@physics.uc.edu
Sun Jan 18 15:45:00 GMT 2004
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.
ChangeLog:
* config/rs6000/rs6000.c (rs6000_special_round_type_align):
Check for NULL in the chain and remove repeated code.
Patch:
Index: rs6000.c
===================================================================
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
specified)
{
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);
More information about the Gcc-patches
mailing list