Commit 5dc4a7f4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c/37171 (Canonical spelling optimization dependency)

	PR c/37171
	* c-parser.c (c_parser_attributes): For keywords use canonical
	spelling for attr_name.

	* gcc.dg/pr37171.c: New test.
	* g++.dg/ext/attrib34.C: New test.

From-SVN: r139317
parent 235f4375
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> 2008-08-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* value-prof.c (check_counter): Revert wrong call to error. * value-prof.c (check_counter): Revert wrong call to error.
......
...@@ -2828,8 +2828,13 @@ c_parser_attributes (c_parser *parser) ...@@ -2828,8 +2828,13 @@ c_parser_attributes (c_parser *parser)
} }
if (!ok) if (!ok)
break; 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); c_parser_consume_token (parser);
if (c_parser_next_token_is_not (parser, CPP_OPEN_PAREN)) 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> 2008-08-20 Arnaud Charlet <charlet@adacore.com>
* gnat.dg/div_no_warning.adb: New test. * gnat.dg/div_no_warning.adb: New test.
......
/* 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" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment