diff mbox

New option -flimit-function-alignment

Message ID yddbmx4o6mq.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Nov. 24, 2016, 10:27 p.m. UTC
Hi Jeff,

>> gcc/
>> 	* common.opt (flimit-function-alignment): New.
>> 	* doc/invoke.texi (-flimit-function-alignment): Document.
>> 	* emit-rtl.h (struct rtl_data): Add max_insn_address field.
>> 	* final.c (shorten_branches): Set it.
>> 	* varasm.c (assemble_start_function): Limit alignment if
>> 	requested.
>>
>> gcc/testsuite/
>> 	* gcc.target/i386/align-limit.c: New test.
> OK.  Sorry for the long delay.

unfortunately, this broke Solaris 12/SPARC bootstrap with /bin/as:

/vol/gcc/src/hg/trunk/local/gcc/varasm.c: In function 'void assemble_start_function(tree, const char*)':
/vol/gcc/src/hg/trunk/local/gcc/varasm.c:1794:11: error: unused variable 'align_log' [-Werror=unused-variable]
       int align_log = align_functions_log;
           ^~~~~~~~~

The following fixes it and allowed bootstrap to complete successfully.
I'm going to commit it as obvious.

	Rainer
diff mbox

Patch

diff --git a/gcc/varasm.c b/gcc/varasm.c
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1791,7 +1791,9 @@  assemble_start_function (tree decl, cons
       && align_functions_log > align
       && optimize_function_for_speed_p (cfun))
     {
+#ifdef ASM_OUTPUT_MAX_SKIP_ALIGN
       int align_log = align_functions_log;
+#endif
       int max_skip = align_functions - 1;
       if (flag_limit_function_alignment && crtl->max_insn_address > 0
 	  && max_skip >= crtl->max_insn_address)