+2008-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37171
+ * c-parser.c (c_parser_attributes): For keywords use canonical
+ spelling for attr_name.
+
2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* value-prof.c (check_counter): Revert wrong call to error.
}
if (!ok)
break;
+ /* Accept __attribute__((__const)) as __attribute__((const))
+ etc. */
+ attr_name
+ = ridpointers[(int) c_parser_peek_token (parser)->keyword];
}
- attr_name = c_parser_peek_token (parser)->value;
+ else
+ attr_name = c_parser_peek_token (parser)->value;
c_parser_consume_token (parser);
if (c_parser_next_token_is_not (parser, CPP_OPEN_PAREN))
{
+2008-08-20 Jakub Jelinek <jakub@redhat.com>
+
+ PR c/37171
+ * gcc.dg/pr37171.c: New test.
+
2008-08-20 Arnaud Charlet <charlet@adacore.com>
* gnat.dg/div_no_warning.adb: New test.
--- /dev/null
+/* PR c/37171 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-optimized" } */
+
+unsigned int f1 (void) __attribute__((const));
+unsigned int f2 (void) __attribute__((__const));
+unsigned int f3 (void) __attribute__((__const__));
+
+unsigned int f4 (void)
+{
+ return f1 () + f1 () + f1 () + f1 ()
+ + f2 () + f2 () + f2 () + f2 ()
+ + f3 () + f3 () + f3 () + f3 ();
+}
+
+/* { dg-final { scan-tree-dump-times "= f1 \\(\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= f2 \\(\\)" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "= f3 \\(\\)" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */