]> git.pld-linux.org Git - packages/gcc.git/blame - gcc-empty-struct-init.patch
make bootstrap for native compiller; release 14
[packages/gcc.git] / gcc-empty-struct-init.patch
CommitLineData
64f9f7bb
JR
1#! /bin/sh -e
2
3if [ $# -eq 3 -a "$2" = '-d' ]; then
4 pdir="-d $3"
5elif [ $# -ne 1 ]; then
6 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7 exit 1
8fi
9case "$1" in
10 -patch) patch $pdir -f --no-backup-if-mismatch -p0 < $0;;
11 -unpatch) patch $pdir -f --no-backup-if-mismatch -R -p0 < $0;;
12 *)
13 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
14 exit 1
15esac
16exit 0
17
18To: gcc-patches at gcc dot gnu dot org
19# DP: Subject: empty struct initializer fix
20# DP: From: Richard Henderson <rth at twiddle dot net>
21# DP: Date: Sun, 20 Feb 2000 00:33:40 -0800
22
23Fixes
24
25 struct empty { };
26 struct something {
27 int spacer;
28 struct empty foo;
29 int bar;
30 };
31
32 struct something X = {
33 foo: (struct empty) { },
34 bar: 1,
35 };
36
37which used to abort.
38
39
40r~
41
42 * c-typeck.c (add_pending_init): Don't abort for multiple
43 fields at the same offset.
44 (pending_init_member): Test the correct member.
45
46--- gcc/c-typeck.c.orig Wed Feb 23 18:38:30 2000
47+++ gcc/c-typeck.c Wed Feb 23 18:38:35 2000
48@@ -5846,7 +5846,7 @@
49 p = *q;
50 if (tree_int_cst_lt (purpose, p->purpose))
51 q = &p->left;
52- else if (tree_int_cst_lt (p->purpose, purpose))
53+ else if (p->purpose != purpose)
54 q = &p->right;
55 else
56 abort ();
57@@ -5860,8 +5860,7 @@
58 if (tree_int_cst_lt (DECL_FIELD_BITPOS (purpose),
59 DECL_FIELD_BITPOS (p->purpose)))
60 q = &p->left;
61- else if (tree_int_cst_lt (DECL_FIELD_BITPOS (p->purpose),
62- DECL_FIELD_BITPOS (purpose)))
63+ else if (p->purpose != purpose)
64 q = &p->right;
65 else
66 abort ();
67@@ -6046,7 +6045,7 @@
68 {
69 while (p)
70 {
71- if (tree_int_cst_equal (field, p->purpose))
72+ if (field == p->purpose)
73 return 1;
74 else if (tree_int_cst_lt (field, p->purpose))
75 p = p->left;
This page took 0.071107 seconds and 4 git commands to generate.