Commit 99da11ec by Martin Sebor Committed by Martin Sebor

c-attribs.c (common_handle_aligned_attribute): Avoid issuing an error for…

c-attribs.c (common_handle_aligned_attribute): Avoid issuing an error for attribute warn_if_not_aligned.


gcc/c-family/ChangeLog:

	* c-attribs.c (common_handle_aligned_attribute): Avoid issuing
	an error for attribute warn_if_not_aligned.

From-SVN: r255767
parent 0ba75dc0
2017-12-17 Martin Sebor <msebor@redhat.com>
* c-attribs.c (common_handle_aligned_attribute): Avoid issuing
an error for attribute warn_if_not_aligned.
2017-12-16 Martin Sebor <msebor@redhat.com>
PR tree-optimization/78918
......
......@@ -1879,14 +1879,17 @@ common_handle_aligned_attribute (tree *node, tree name, tree args, int flags,
curalign /= BITS_PER_UNIT;
bitalign /= BITS_PER_UNIT;
bool diagd = true;
if (DECL_USER_ALIGN (decl) || DECL_USER_ALIGN (last_decl))
warning (OPT_Wattributes,
"ignoring attribute %<%E (%u)%> because it conflicts with "
"attribute %<%E (%u)%>", name, bitalign, name, curalign);
else
diagd = warning (OPT_Wattributes,
"ignoring attribute %<%E (%u)%> because it conflicts "
"with attribute %<%E (%u)%>",
name, bitalign, name, curalign);
else if (!warn_if_not_aligned_p)
/* Do not error out for attribute warn_if_not_aligned. */
error ("alignment for %q+D must be at least %d", decl, curalign);
if (note)
if (diagd && note)
inform (DECL_SOURCE_LOCATION (last_decl), "previous declaration here");
*no_add_attrs = true;
......
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