Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
Hi Gerald, > On Sun, 22 Jul 2018, Gerald Pfeifer wrote: >> With clang version 3.4 (system compiler on FreeBSD 10.x) this is >> even a hard error and GCC failed to build. So thanks for fixing >> this, Martin! > > Unfortunately it appears there was another bootstrap failure hidden > behind that one: > > > In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/system.h:691, > from /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vect-slp.c:23: > /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vect-slp.c: In function > ‘_slp_tree* vect_build_slp_tree_2(vec_info*, vec, unsigned int, > poly_uint64*, vec<_slp_tree*>*, bool*, unsigned int*, unsigned int*, > unsigned int)’: > /scratch/tmp/gerald/GCC-HEAD/gcc/../include/libiberty.h:722:36: error: > ‘alloca’ bound is unknown [-Werror=alloca-larger-than=] > # define alloca(x) __builtin_alloca(x) > ^~~ > /scratch/tmp/gerald/GCC-HEAD/gcc/../include/libiberty.h:356:33: note: in > expansion of macro ‘alloca’ > #define XALLOCAVEC(T, N) ((T *) alloca (sizeof (T) * (N))) > ^~ > /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vect-slp.c:1437:16: note: in expansion > of macro ‘XALLOCAVEC’ > bool *tem = XALLOCAVEC (bool, group_size); > ^~ > cc1plus: all warnings being treated as errors > gmake[3]: *** [Makefile:1112: tree-vect-slp.o] Error 1 > gmake[3]: Leaving directory '/scratch/tmp/gerald/OBJ-0722-0939/gcc' > gmake[2]: *** [Makefile:4644: all-stage2-gcc] Error 2 > > > This is on FreeBSD 10.4 which features clang 3.4.1 as system compiler; > FreeBSD 11.2 with clang 6.0.0 does not trigger that. known issue: PR bootstrap/86621. Rainer -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
On Sun, 22 Jul 2018, Gerald Pfeifer wrote: > With clang version 3.4 (system compiler on FreeBSD 10.x) this is > even a hard error and GCC failed to build. So thanks for fixing > this, Martin! Unfortunately it appears there was another bootstrap failure hidden behind that one: In file included from /scratch/tmp/gerald/GCC-HEAD/gcc/system.h:691, from /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vect-slp.c:23: /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vect-slp.c: In function ‘_slp_tree* vect_build_slp_tree_2(vec_info*, vec, unsigned int, poly_uint64*, vec<_slp_tree*>*, bool*, unsigned int*, unsigned int*, unsigned int)’: /scratch/tmp/gerald/GCC-HEAD/gcc/../include/libiberty.h:722:36: error: ‘alloca’ bound is unknown [-Werror=alloca-larger-than=] # define alloca(x) __builtin_alloca(x) ^~~ /scratch/tmp/gerald/GCC-HEAD/gcc/../include/libiberty.h:356:33: note: in expansion of macro ‘alloca’ #define XALLOCAVEC(T, N) ((T *) alloca (sizeof (T) * (N))) ^~ /scratch/tmp/gerald/GCC-HEAD/gcc/tree-vect-slp.c:1437:16: note: in expansion of macro ‘XALLOCAVEC’ bool *tem = XALLOCAVEC (bool, group_size); ^~ cc1plus: all warnings being treated as errors gmake[3]: *** [Makefile:1112: tree-vect-slp.o] Error 1 gmake[3]: Leaving directory '/scratch/tmp/gerald/OBJ-0722-0939/gcc' gmake[2]: *** [Makefile:4644: all-stage2-gcc] Error 2 This is on FreeBSD 10.4 which features clang 3.4.1 as system compiler; FreeBSD 11.2 with clang 6.0.0 does not trigger that. Gerald
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
On Wed, 18 Jul 2018, Martin Sebor wrote: > I'm seeing lots of warnings for this file: > > /ssd/src/gcc/svn/gcc/align.h:53:32: warning: extended initializer lists only > available with -std=c++11 or -std=gnu++11 With clang version 3.4 (system compiler on FreeBSD 10.x) this is even a hard error and GCC failed to build. So thanks for fixing this, Martin! Gerald
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
On 07/04/2018 04:23 AM, marxin wrote: gcc/ChangeLog: 2018-07-11 Martin Liska * align.h: New file. Martin, I'm seeing lots of warnings for this file: /ssd/src/gcc/svn/gcc/align.h:53:32: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11 The code that triggers them is: +struct align_flags +{ + /* Default constructor. */ + align_flags (int log0 = 0, int maxskip0 = 0, int log1 = 0, int maxskip1 = 0) + { +levels[0] = {log0, maxskip0}; +levels[1] = {log1, maxskip1}; +normalize (); + } This form of assignment isn't valid in C++ 98. Thanks Martin
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
On 07/18/2018 05:52 AM, Michael Collison wrote: > Hi Martin, > > Your alignment patch breaks the arm port. In the file arm.c, function > 'get_label_padding' the code uses: > > static HOST_WIDE_INT > get_label_padding (rtx label) > { > HOST_WIDE_INT align, min_insn_size; > > align = 1 << label_to_alignment (label); > min_insn_size = TARGET_THUMB ? 2 : 4; > return align > min_insn_size ? align - min_insn_size : 0; > } > > Which breaks with your current change. I think this needs to be modified to: > > 'align = 1 << label_to_alignment (label).levels[0].log' Hello. Sorry for the breakage, thank to Jeff it's fixed in this way. r262848 should be fine. Martin > > Regards, > > Michael Collison >
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
Hi Martin, Your alignment patch breaks the arm port. In the file arm.c, function 'get_label_padding' the code uses: static HOST_WIDE_INT get_label_padding (rtx label) { HOST_WIDE_INT align, min_insn_size; align = 1 << label_to_alignment (label); min_insn_size = TARGET_THUMB ? 2 : 4; return align > min_insn_size ? align - min_insn_size : 0; } Which breaks with your current change. I think this needs to be modified to: 'align = 1 << label_to_alignment (label).levels[0].log' Regards, Michael Collison
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
On 07/16/2018 11:24 PM, Jeff Law wrote: > All 4 patches in this kit are fine after you fix the minor issue Pat > reported with patch #1 on ppc. > > Jeff Thank you Jeff for the trust. I fixed the minor issue and installed the patch set. Martin
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
On 07/04/2018 04:23 AM, marxin wrote: > gcc/ChangeLog: > > 2018-07-11 Martin Liska > > * align.h: New file. > * config/alpha/alpha.c (alpha_align_insns_1): Use align_functions > directly. > * config/i386/i386.c (ix86_avoid_jump_mispredicts): Use new return type > align_flags of label_to_alignment. > * config/m32r/m32r.h (LOOP_ALIGN): Wrap returned values into align_flags > class. > * config/m68k/m68k.c: Do not use removed align_labels_value and > align_loops_value. > * config/nds32/nds32.h (JUMP_ALIGN): Wrap result into align_flags class. > (LOOP_ALIGN): Likewise. > (LABEL_ALIGN): Likewise. > * config/powerpcspe/powerpcspe.c (TARGET_ASM_LOOP_ALIGN_MAX_SKIP): > Remove not used macro. > (rs6000_loop_align): Change return type to align_flags. > (rs6000_loop_align_max_skip): Remove. > * config/rs6000/rs6000-protos.h (rs6000_loop_align): > Change return type to align_flags. > * config/rs6000/rs6000.c (TARGET_ASM_LOOP_ALIGN_MAX_SKIP): > Remove not used macro. > (rs6000_loop_align): Change return type to align_flags. > (rs6000_loop_align_max_skip): Remove. > * config/rx/rx.h (JUMP_ALIGN): Wrap integer values > * config/rx/rx-protos.h (rx_align_for_label): Make it > static function. > * config/rx/rx.c (rx_align_for_label): Change return type > to align_flags. > (rx_max_skip_for_label): Remove TARGET_ASM_*_ALIGN_MAX_SKIP > macro definitions. > into align_flags class. > (LABEL_ALIGN): Likewise. > (LOOP_ALIGN): Likewise. > * config/s390/s390.c (s390_label_align): Use align_flags > class member. > (s390_asm_output_function_label): Likewise. > * config/sh/sh.c (sh_override_options_after_change): > Use align_flags class directly without macros. > (find_barrier): Likewise. > (barrier_align): Likewise. > (sh_loop_align): Likewise. > * config/spu/spu.c (spu_option_override): > Use align_flags_tuple::get_value instead of removed macros. > (spu_sched_init): Likewise. > * config/spu/spu.h (GTY): Likewise. > * config/visium/visium.c (visium_option_override): > Set "8" as default secondary alignment. > * config/visium/visium.h (SUBALIGN_LOG): Define to 3 > in order to guarantee secondary alignment of 8. > * coretypes.h: Include align.h header file. > * doc/tm.texi: Remove TARGET_ASM_JUMP_ALIGN_MAX_SKIP, > TARGET_ASM_LOOP_ALIGN_MAX_SKIP, TARGET_ASM_LABEL_ALIGN_MAX_SKIP > and TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP macros. > * doc/tm.texi.in: Likewise. > * final.c (struct label_alignment): Remove not used structure. > (LABEL_ALIGN): Change type to align_flags. > (LOOP_ALIGN): Likewise. > (JUMP_ALIGN): Likewise. > (default_loop_align_max_skip): Remove. > (default_label_align_max_skip): Likewise. > (default_jump_align_max_skip): Likewise. > (default_label_align_after_barrier_max_skip): > (LABEL_TO_ALIGNMENT): Change to access label_align vector. > (LABEL_TO_MAX_SKIP): Remove. > (label_to_alignment): Return align_flags type instead of integer. > (label_to_max_skip): Remove. > (align_fuzz): Use align_flags type. > (compute_alignments): Use align_flags type and use align_flags::max > to combine multiple alignments. > (grow_label_align): Grow vec instead of C array. > (update_alignments): Assign just LABEL_TO_ALIGNMENT. > (shorten_branches): Use align_flags type and use align_flags::max > to combine multiple alignments. > (final_scan_insn_1): Remove usage of secondary alignment that comes > from label alignment, but instead use proper secondary alignment > which is computed in grow_label_align. > * flags.h (struct align_flags_tuple): Move to align.h. > (struct align_flags): Likewise. > (state_align_loops): Rename to align_loops. > (state_align_jumps): Rename to align_jumps. > (state_align_labels): Rename to align_labels. > (state_align_functions): Rename to align_functions. > (align_loops_log): Remove. > (align_jumps_log): Remove. > (align_labels_log): Remove. > (align_functions_log): Remove. > (align_loops_max_skip): Remove. > (align_jumps_max_skip): Remove. > (align_labels_max_skip): Remove. > (align_functions_max_skip): Remove. > (align_loops_value): Remove. > (align_jumps_value): Remove. > (align_labels_value): Remove. > (align_functions_value): Remove. > * output.h (label_to_alignment): Change return type to align_flags. > (label_to_max_skip): Remove. > * target.def: Remove loop_align_max_skip, label_align_max_skip, > jump_align_max_skip macros. > * targhooks.h (default_loop_align_max_skip): Remove. >
Re: [PATCH 1/4] Clean up of new format of -falign-FOO.
testsuite/gcc.target/powerpc/loop_align.c fails with this patch. It just needs a simple tweak to the scan-assembler line since we're no longer generating the ",,31" portion on the .p2align. -Pat
[PATCH 1/4] Clean up of new format of -falign-FOO.
gcc/ChangeLog: 2018-07-11 Martin Liska * align.h: New file. * config/alpha/alpha.c (alpha_align_insns_1): Use align_functions directly. * config/i386/i386.c (ix86_avoid_jump_mispredicts): Use new return type align_flags of label_to_alignment. * config/m32r/m32r.h (LOOP_ALIGN): Wrap returned values into align_flags class. * config/m68k/m68k.c: Do not use removed align_labels_value and align_loops_value. * config/nds32/nds32.h (JUMP_ALIGN): Wrap result into align_flags class. (LOOP_ALIGN): Likewise. (LABEL_ALIGN): Likewise. * config/powerpcspe/powerpcspe.c (TARGET_ASM_LOOP_ALIGN_MAX_SKIP): Remove not used macro. (rs6000_loop_align): Change return type to align_flags. (rs6000_loop_align_max_skip): Remove. * config/rs6000/rs6000-protos.h (rs6000_loop_align): Change return type to align_flags. * config/rs6000/rs6000.c (TARGET_ASM_LOOP_ALIGN_MAX_SKIP): Remove not used macro. (rs6000_loop_align): Change return type to align_flags. (rs6000_loop_align_max_skip): Remove. * config/rx/rx.h (JUMP_ALIGN): Wrap integer values * config/rx/rx-protos.h (rx_align_for_label): Make it static function. * config/rx/rx.c (rx_align_for_label): Change return type to align_flags. (rx_max_skip_for_label): Remove TARGET_ASM_*_ALIGN_MAX_SKIP macro definitions. into align_flags class. (LABEL_ALIGN): Likewise. (LOOP_ALIGN): Likewise. * config/s390/s390.c (s390_label_align): Use align_flags class member. (s390_asm_output_function_label): Likewise. * config/sh/sh.c (sh_override_options_after_change): Use align_flags class directly without macros. (find_barrier): Likewise. (barrier_align): Likewise. (sh_loop_align): Likewise. * config/spu/spu.c (spu_option_override): Use align_flags_tuple::get_value instead of removed macros. (spu_sched_init): Likewise. * config/spu/spu.h (GTY): Likewise. * config/visium/visium.c (visium_option_override): Set "8" as default secondary alignment. * config/visium/visium.h (SUBALIGN_LOG): Define to 3 in order to guarantee secondary alignment of 8. * coretypes.h: Include align.h header file. * doc/tm.texi: Remove TARGET_ASM_JUMP_ALIGN_MAX_SKIP, TARGET_ASM_LOOP_ALIGN_MAX_SKIP, TARGET_ASM_LABEL_ALIGN_MAX_SKIP and TARGET_ASM_LABEL_ALIGN_AFTER_BARRIER_MAX_SKIP macros. * doc/tm.texi.in: Likewise. * final.c (struct label_alignment): Remove not used structure. (LABEL_ALIGN): Change type to align_flags. (LOOP_ALIGN): Likewise. (JUMP_ALIGN): Likewise. (default_loop_align_max_skip): Remove. (default_label_align_max_skip): Likewise. (default_jump_align_max_skip): Likewise. (default_label_align_after_barrier_max_skip): (LABEL_TO_ALIGNMENT): Change to access label_align vector. (LABEL_TO_MAX_SKIP): Remove. (label_to_alignment): Return align_flags type instead of integer. (label_to_max_skip): Remove. (align_fuzz): Use align_flags type. (compute_alignments): Use align_flags type and use align_flags::max to combine multiple alignments. (grow_label_align): Grow vec instead of C array. (update_alignments): Assign just LABEL_TO_ALIGNMENT. (shorten_branches): Use align_flags type and use align_flags::max to combine multiple alignments. (final_scan_insn_1): Remove usage of secondary alignment that comes from label alignment, but instead use proper secondary alignment which is computed in grow_label_align. * flags.h (struct align_flags_tuple): Move to align.h. (struct align_flags): Likewise. (state_align_loops): Rename to align_loops. (state_align_jumps): Rename to align_jumps. (state_align_labels): Rename to align_labels. (state_align_functions): Rename to align_functions. (align_loops_log): Remove. (align_jumps_log): Remove. (align_labels_log): Remove. (align_functions_log): Remove. (align_loops_max_skip): Remove. (align_jumps_max_skip): Remove. (align_labels_max_skip): Remove. (align_functions_max_skip): Remove. (align_loops_value): Remove. (align_jumps_value): Remove. (align_labels_value): Remove. (align_functions_value): Remove. * output.h (label_to_alignment): Change return type to align_flags. (label_to_max_skip): Remove. * target.def: Remove loop_align_max_skip, label_align_max_skip, jump_align_max_skip macros. * targhooks.h (default_loop_align_max_skip): Remove. (default_label_align_max_skip): Likewise. (default_jump_align_max_skip):