539c666d2b28e9102a6ed754d2f9cb17d694e1c6
[buildroot.git] /
1 Index: gcc-4.2.2/gcc/config/avr32/avr32.c
2 ===================================================================
3 --- gcc-4.2.2.orig/gcc/config/avr32/avr32.c 2008-09-19 14:29:20.000000000 +0200
4 +++ gcc-4.2.2/gcc/config/avr32/avr32.c 2008-09-19 14:30:02.000000000 +0200
5 @@ -1788,7 +1788,7 @@
6 {
7 if (TREE_CODE (*node) != FUNCTION_DECL)
8 {
9 - warning ("`%s' attribute only applies to functions",
10 + warning (OPT_Wattributes,"`%s' attribute only applies to functions",
11 IDENTIFIER_POINTER (name));
12 *no_add_attrs = true;
13 }
14 @@ -1802,7 +1802,7 @@
15 {
16 if (avr32_isr_value (args) == AVR32_FT_UNKNOWN)
17 {
18 - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
19 + warning (OPT_Wattributes,"`%s' attribute ignored", IDENTIFIER_POINTER (name));
20 *no_add_attrs = true;
21 }
22 }
23 @@ -1829,7 +1829,7 @@
24 }
25 else
26 {
27 - warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
28 + warning (OPT_Wattributes,"`%s' attribute ignored", IDENTIFIER_POINTER (name));
29 }
30 }
31 }
32 @@ -1847,7 +1847,7 @@
33 {
34 if (TREE_CODE (*node) != FUNCTION_DECL)
35 {
36 - warning ("%qs attribute only applies to functions",
37 + warning (OPT_Wattributes,"%qs attribute only applies to functions",
38 IDENTIFIER_POINTER (name));
39 *no_add_attrs = true;
40 }
41 @@ -1866,13 +1866,13 @@
42 {
43 if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == METHOD_TYPE)
44 {
45 - warning ("`%s' attribute not yet supported...",
46 + warning (OPT_Wattributes,"`%s' attribute not yet supported...",
47 IDENTIFIER_POINTER (name));
48 *no_add_attrs = true;
49 return NULL_TREE;
50 }
51
52 - warning ("`%s' attribute only applies to functions",
53 + warning (OPT_Wattributes,"`%s' attribute only applies to functions",
54 IDENTIFIER_POINTER (name));
55 *no_add_attrs = true;
56 return NULL_TREE;
57 @@ -4215,51 +4215,6 @@
58
59
60 void
61 -avr32_asm_output_ascii (FILE * stream, char *ptr, int len)
62 -{
63 - int i, i_new = 0;
64 - char *new_ptr = xmalloc (4 * len);
65 - if (new_ptr == NULL)
66 - internal_error ("Out of memory.");
67 -
68 - for (i = 0; i < len; i++)
69 - {
70 - if (ptr[i] == '\n')
71 - {
72 - new_ptr[i_new++] = '\\';
73 - new_ptr[i_new++] = '0';
74 - new_ptr[i_new++] = '1';
75 - new_ptr[i_new++] = '2';
76 - }
77 - else if (ptr[i] == '\"')
78 - {
79 - new_ptr[i_new++] = '\\';
80 - new_ptr[i_new++] = '\"';
81 - }
82 - else if (ptr[i] == '\\')
83 - {
84 - new_ptr[i_new++] = '\\';
85 - new_ptr[i_new++] = '\\';
86 - }
87 - else if (ptr[i] == '\0' && i + 1 < len)
88 - {
89 - new_ptr[i_new++] = '\\';
90 - new_ptr[i_new++] = '0';
91 - }
92 - else
93 - {
94 - new_ptr[i_new++] = ptr[i];
95 - }
96 - }
97 -
98 - /* Terminate new_ptr. */
99 - new_ptr[i_new] = '\0';
100 - fprintf (stream, "\t.ascii\t\"%s\"\n", new_ptr);
101 - free (new_ptr);
102 -}
103 -
104 -
105 -void
106 avr32_asm_output_label (FILE * stream, const char *name)
107 {
108 name = avr32_strip_name_encoding (name);
109 @@ -4444,12 +4399,15 @@
110 rtx cmp;
111 rtx cmp_op0, cmp_op1;
112 rtx cond;
113 + rtx dest;
114 +
115 if ( GET_CODE (exp) == COND_EXEC )
116 {
117 cmp_op0 = XEXP (COND_EXEC_TEST (exp), 0);
118 cmp_op1 = XEXP (COND_EXEC_TEST (exp), 1);
119 cond = COND_EXEC_TEST (exp);
120 - }
121 + dest = SET_DEST (COND_EXEC_CODE (exp));
122 + }
123 else
124 {
125 /* If then else conditional. compare operands are in operands
126 @@ -4457,6 +4415,7 @@
127 cmp_op0 = recog_data.operand[4];
128 cmp_op1 = recog_data.operand[5];
129 cond = recog_data.operand[1];
130 + dest = SET_DEST (exp);
131 }
132
133 if ( GET_CODE (cmp_op0) == AND )
134 @@ -4466,7 +4425,15 @@
135 cmp_op0,
136 cmp_op1);
137
138 - if (is_compare_redundant (cmp, cond) == NULL_RTX)
139 + /* Check if the conditional insns updates a register present
140 + in the comparison, if so then we must reset the cc_status. */
141 + if (REG_P (dest)
142 + && (reg_mentioned_p (dest, cmp_op0)
143 + || reg_mentioned_p (dest, cmp_op1)))
144 + {
145 + CC_STATUS_INIT;
146 + }
147 + else if (is_compare_redundant (cmp, cond) == NULL_RTX)
148 {
149 /* Reset the nonstandard flag */
150 CC_STATUS_INIT;