Skip to content

Gcc 6 branch csky #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1,000 commits into from
Closed

Gcc 6 branch csky #11

wants to merge 1,000 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jun 4, 2017

create branch gcc-6-branch-csky

wschmidt and others added 30 commits October 24, 2016 02:36
2016-10-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2016-10-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/77916
	* gimple-ssa-strength-reduction.c (create_add_on_incoming_edge):
	Don't allow a MINUS_EXPR for pointer arithmetic for either known
	or unknown strides.
	(record_increment): Increments of -1 for unknown strides just use
	a multiply initializer like other negative values.
	(analyze_increments): Remove stopgap solution for -1 increment
	applied to pointer arithmetic.
	(insert_initializers): Requirement of initializer for -1 should be
	based on pointer-typedness of the candidate basis.

[gcc/testsuite]

2016-10-23  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	2016-10-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR tree-optimization/77916
	* gcc.dg/torture/pr77916.c: New.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241461 138bc75d-0d04-0410-961f-82ee72b054a4
	2016-10-24  Ville Voutilainen  <ville.voutilainen@gmail.com>

	Cross-port the latest resolution of LWG2756 and some
	bug-fixes to experimental::optional.
	PR libstdc++/77288
	PR libstdc++/77727
	* include/experimental/optional (_Optional_base):
	Remove constructors that take a _Tp.
	(__is_optional_impl, __is_optional): Remove.
	(__converts_from_optional): New.
	(optional(_Up&&)): Fix constraints, call base with in_place.
	(optional(const optional<_Up>&)): Fix constraints, use emplace.
	(optional(optional<_Up>&&)): Likewise.
	(operator=(_Up&&)): Fix constraints.
	(operator=(const optional<_Up>&)): Likewise.
	(operator=(optional<_Up>&&)): Likewise.
	(emplace(_Args&&...)): Constrain.
	(emplace(initializer_list<_Up>, _Args&&...)): Likewise.
	* testsuite/experimental/optional/77288.cc: New.
	* testsuite/experimental/optional/assignment/5.cc: Adjust.
	* testsuite/experimental/optional/cons/77727.cc: New.
	* testsuite/experimental/optional/cons/value.cc: Adjust.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241477 138bc75d-0d04-0410-961f-82ee72b054a4
	PR fortran/71895
	* interface.c (gfc_compare_derived_types):  Convert gcc_assert()
	to a gfc_internal_error() to prevent an ICE.

2016-10-24  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/71895
	* gfortran.dg/pr71895.f90: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241494 138bc75d-0d04-0410-961f-82ee72b054a4
        Backport from mainline
        2016-09-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>

        PR tree-optimization/77550
        * tree-vect-stmts.c (create_array_ref): Change parameters.
        (get_group_alias_ptr_type): New function.
        (vectorizable_store, vectorizable_load): Use get_group_alias_ptr_type.

        testsuite:
        2016-09-21  Bernd Edlinger  <bernd.edlinger@hotmail.de>
        
        PR tree-optimization/77550
        * g++.dg/pr77550.C: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241495 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241501 138bc75d-0d04-0410-961f-82ee72b054a4
	* tree.c (int_fits_type_p): Likewise.  Adjust head comment.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241530 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241544 138bc75d-0d04-0410-961f-82ee72b054a4
	2016-10-21  Jakub Jelinek  <jakub@redhat.com>

	PR target/78057
	* config/i386/i386.c: Include fold-const-call.h, tree-vrp.h
	and tree-ssanames.h.
	(ix86_fold_builtin): Fold IX86_BUILTIN_[LT]ZCNT{16,32,64}
	with INTEGER_CST argument.
	(ix86_gimple_fold_builtin): New function.
	(TARGET_GIMPLE_FOLD_BUILTIN): Define.

	Backport from mainline
	2016-10-20 Uros Bizjak  <ubizjak@gmail.com>

	PR target/78037
	* config/i386/bmiintrin.h (__tzcnt_u16): Call __builtin_ia32_tzcnt_u16.
	(__tzcnt_u32, _tzcnt_u32): Call __builtin_ia32_tzcnt_u32.
	(__tzcnt_u64, _tzcnt_u64): Call __builtin_ia32_tzcnt_u64.
	* config/i386/lzcntintrin.h (__lzcnt_u16): Call
	__builtin_ia32_lzcnt_u16.
	(__lzcnt_u32, _lzcnt_u32): Call __builtin_ia32_lzcnt_u32.
	(__lzcnt_u64, _lzcnt_u64): Call __builtin_ia32_lzcnt_u64.
	* config/i386/i386.md (UNSPEC_LZCNT, UNSPEC_TZCNT): New unspecs.
	(ctz<mode>2, *ctz<mode>2): Use SWI48 mode iterator.
	(bmi_tzcnt_<mode>): New expander.
	(*bmi_tzcnt_<mode>_falsedep_1): New define_insn_and_split pattern.
	(*bmi_tzcnt_<mode>_falsedep, *bmi_tzcnt_<mode>): New insn patterns.
	(clz<mode>2_lzcnt, *clz<mode>2_lzcnt): Use SWI48 mode iterator.
	(lzcnt_<mode>): New expander.
	(*lzcnt_<mode>_falsedep_1): New define_insn_and_split pattern.
	(*lzcnt_<mode>_falsedep, *lzcnt_<mode>): New insn patterns.
	* config/i386/i386-builtin-types.def (UINT_FTYPE_UINT): New.
	(UINT64_FTYPE_UINT64): New.
	* config/i386/i386-builtin.def (__builtin_clzs): Remove description.
	(__builtin_ia32_lzcnt_u16): New description.
	(__builtin_ia32_lzcnt_u32): Ditto.
	(__builtin_ia32_lzcnt_u64): Ditto.
	(__builtin_ctzs): Remove description.
	(__builtin_ia32_tzcnt_u16): New description.
	(__builtin_ia32_tzcnt_u32): Ditto.
	(__builtin_ia32_tzcnt_u64): Ditto.
	* config/i386/i386.c (ix86_expand_args_builtin): Handle
	UINT_FTYPE_UINT and UINT64_FTYPE_UINT64.

testsuite/ChangeLog:

	* gcc.target/i386/bmi-6.c: XFAIL.

	Backport from mainline
	2016-10-21  Jakub Jelinek  <jakub@redhat.com>

	PR target/78057
	* gcc.target/i386/pr78057.c: New test.

	Backport from mainline
	2016-10-20  Uros Bizjak  <ubizjak@gmail.com>

	PR target/78037
	* gcc.target/i386/pr78037.c: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241556 138bc75d-0d04-0410-961f-82ee72b054a4
	PR fortran/78108
	* resolve.c (resolve_typebound_intrinsic_op): For submodules
	suppress the error and return if the same procedure symbol
	is added more than once to the interface.

2016-10-26  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/78108
	* gfortran.dg/submodule_18.f08: New test.
	* gfortran.dg/submodule_19.f08: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241575 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241608 138bc75d-0d04-0410-961f-82ee72b054a4
	PR fortran/78092
	* trans-intrinsic.c (gfc_conv_intrinsic_sizeof):  Fix reference to an
	array element of type CLASS.

2016-10-26  Steven G. Kargl <kargl@gcc.gnu.org>

	PR fortran/78092
	* gfortran.dg/pr78092.f90: New test.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241611 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241639 138bc75d-0d04-0410-961f-82ee72b054a4
	PR middle-end/78128
	PR middle-end/71002
	* fold-const.c (make_bit_field_ref): Only adjust alias set
	when the original alias set was zero.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241646 138bc75d-0d04-0410-961f-82ee72b054a4
	* c-pretty-print.c (simple_type_specifier): Do not dereference `t'
	if NULL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241657 138bc75d-0d04-0410-961f-82ee72b054a4
    libgo: incorporate fix for timezone test
    
    This brings over the test-only fix for issue 17276 into gccgo/libgo
    (with tzdata-2016g there is a new zone abbreviation).  This is a
    copy of https://golang.org/cl/29995.
    
    Reviewed-on: https://go-review.googlesource.com/32182


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241662 138bc75d-0d04-0410-961f-82ee72b054a4
	PR fortran/71891
	* symbol.c (gfc_type_compatible): Fix typo.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241669 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241671 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241674 138bc75d-0d04-0410-961f-82ee72b054a4
	(MALLOC_ABI_ALIGNMENT): Define.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241677 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241683 138bc75d-0d04-0410-961f-82ee72b054a4
	Backport from trunk
	PR fortran/67219
	* arith.c (gfc_int2real):  Change gfc_warning_now
	to gfc_warning.
	* primary.c (match_complex_constant):  If there
	is no comma, throw away any warning which might have
	been issued by gfc_int2real.

2016-10-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/67219
	* gfortran.dg/pr67219.f90:  New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241690 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241693 138bc75d-0d04-0410-961f-82ee72b054a4
	Backport from trunk
	PR fortran/71902
	* frontend-passes.c (realloc_string_callback): Also check for the
	lhs being deferred.  Name temporary variable "realloc_string".

2016-10-31  Thomas Koenig  <tkoenig@gcc.gnu.org>

	Backport from trunk
	PR fortran/71902
	* gfortran.dg/dependency_47.f90:  New test.
	* gfortran.dg/dependency_49.f90:  New test



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241717 138bc75d-0d04-0410-961f-82ee72b054a4
	Backport from trunk
	PR libgfortran/78123
	* io/transfer.c (formatted_transfer_scalar_read): Clear seen_eor
	only if we have tabbed to left of current position.
	Backport from trunk
	PR fortran/78123
	* gfortran.dg/fmt_t_9.f: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241722 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241729 138bc75d-0d04-0410-961f-82ee72b054a4
…nitions in ree

	Backport from mainline
	2016-10-21  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

	PR rtl-optimization/78038
	* ree.c (get_defs): Return NULL if a defining insn for REG cannot
	be deduced to set REG through the RTL structure.
	(make_defs_and_copies_lists): Return false on a failing get_defs call.

	* gcc.target/aarch64/pr78038.c: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241735 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241738 138bc75d-0d04-0410-961f-82ee72b054a4
	* config/pa/pa.md: Add new shift/add patterns to handle
	(plus (mult (reg) (mem_shadd_operand)) (reg)) source operand.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241750 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241763 138bc75d-0d04-0410-961f-82ee72b054a4
	Backport from mainline
	2016-10-24  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc-interface/Make-lang.in (lang_checks_parallelized): New target.
	(check_gnat_parallelize): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@241781 138bc75d-0d04-0410-961f-82ee72b054a4
gccadmin added 2 commits December 21, 2016 00:16
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243834 138bc75d-0d04-0410-961f-82ee72b054a4
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243836 138bc75d-0d04-0410-961f-82ee72b054a4
@ghost ghost closed this Jun 4, 2017
janusw pushed a commit to janusw/gcc that referenced this pull request Oct 1, 2018
This patch adds basic support for SVE stack clash protection.
It is a first implementation and will use a loop to do the
probing and stack adjustments.

An example sequence is:

        .cfi_startproc
        mov     x15, sp
        cntb    x16, all, mul gcc-mirror#11
        add     x16, x16, 304
        .cfi_def_cfa_register 15
.SVLPSPL0:
        cmp     x16, 61440
        b.lt    .SVLPEND0
        sub     sp, sp, 61440
        str     xzr, [sp, 0]
        sub     x16, x16, 61440
        b      .SVLPSPL0
.SVLPEND0:
        sub     sp, sp, x16
        .cfi_escape 0xf,0xc,0x8f,0,0x92,0x2e,0,0x8,0x58,0x1e,0x23,0xb0,0x2,0x22

for a 64KB guard size, and for a 4KB guard size

        .cfi_startproc
        mov     x15, sp
        cntb    x16, all, mul gcc-mirror#11
        add     x16, x16, 304
        .cfi_def_cfa_register 15
.SVLPSPL0:
        cmp     x16, 3072
        b.lt    .SVLPEND0
        sub     sp, sp, 3072
        str     xzr, [sp, 0]
        sub     x16, x16, 3072
        b       .SVLPSPL0
.SVLPEND0:
        sub     sp, sp, x16
        .cfi_escape 0xf,0xc,0x8f,0,0x92,0x2e,0,0x8,0x58,0x1e,0x23,0xb0,0x2,0x22

This has about the same semantics as alloca, except we prioritize the common case
where no probe is required.  We also change the amount we adjust the stack and
the probing interval to be the nearest value to `guard size - abi buffer` that
fits in the 12-bit shifted immediate used by cmp.

While this would mean we probe a bit more often than we require, in practice the
amount of SVE vectors you'd need to spill is significant. Even more so to enter the
loop more than once.


gcc/

	PR target/86486
	* config/aarch64/aarch64-protos.h (aarch64_output_probe_sve_stack_clash): New.
	* config/aarch64/aarch64.c (aarch64_output_probe_sve_stack_clash,
	aarch64_clamp_to_uimm12_shift): New.
	(aarch64_allocate_and_probe_stack_space): Add SVE specific section.
	* config/aarch64/aarch64.md (probe_sve_stack_clash): New.

gcc/testsuite/

	PR target/86486
	* gcc.target/aarch64/stack-check-prologue-16.c: New test
	* gcc.target/aarch64/stack-check-cfa-3.c: New test.
	* gcc.target/aarch64/sve/struct_vect_24.c: New test.
	* gcc.target/aarch64/sve/struct_vect_24_run.c: New test.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264749 138bc75d-0d04-0410-961f-82ee72b054a4
kraj pushed a commit to kraj/gcc that referenced this pull request Oct 12, 2020
Prevents the following UBSAN error:

./xgcc -B. /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/torture/pr49770.C -O2 -c
/home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482:22: runtime error: load of value 2, which is not a valid value for type 'bool'
    #0 0x1fdb4d1 in modref_tree<int>::merge(modref_tree<int>*, vec<modref_parm_map, va_heap, vl_ptr>*) /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482
    #1 0x1fcadaa in merge_call_side_effects(modref_summary*, gimple*, modref_summary*, bool) /home/marxin/Programming/gcc2/gcc/ipa-modref.c:511
    gcc-mirror#2 0x1fcbadd in analyze_call /home/marxin/Programming/gcc2/gcc/ipa-modref.c:642
    gcc-mirror#3 0x1fcc061 in analyze_stmt /home/marxin/Programming/gcc2/gcc/ipa-modref.c:732
    gcc-mirror#4 0x1fccf31 in analyze_function /home/marxin/Programming/gcc2/gcc/ipa-modref.c:823
    gcc-mirror#5 0x1fd17e5 in execute /home/marxin/Programming/gcc2/gcc/ipa-modref.c:1441
    gcc-mirror#6 0x25cca6e in execute_one_pass(opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2509
    gcc-mirror#7 0x25cd39b in execute_pass_list_1 /home/marxin/Programming/gcc2/gcc/passes.c:2597
    gcc-mirror#8 0x25cd450 in execute_pass_list_1 /home/marxin/Programming/gcc2/gcc/passes.c:2598
    gcc-mirror#9 0x25cd4ee in execute_pass_list(function*, opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2608
    gcc-mirror#10 0x25c7a5a in do_per_function_toporder(void (*)(function*, void*), void*) /home/marxin/Programming/gcc2/gcc/passes.c:1726
    gcc-mirror#11 0x25cfa3f in execute_ipa_pass_list(opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2941
    gcc-mirror#12 0x173572d in ipa_passes /home/marxin/Programming/gcc2/gcc/cgraphunit.c:2642
    gcc-mirror#13 0x17364ee in symbol_table::compile() /home/marxin/Programming/gcc2/gcc/cgraphunit.c:2777
    gcc-mirror#14 0x17372d9 in symbol_table::finalize_compilation_unit() /home/marxin/Programming/gcc2/gcc/cgraphunit.c:3022
    gcc-mirror#15 0x2a1f00a in compile_file /home/marxin/Programming/gcc2/gcc/toplev.c:485
    gcc-mirror#16 0x2a27dc8 in do_compile /home/marxin/Programming/gcc2/gcc/toplev.c:2321
    gcc-mirror#17 0x2a283cc in toplev::main(int, char**) /home/marxin/Programming/gcc2/gcc/toplev.c:2460
    gcc-mirror#18 0x54f21cd in main /home/marxin/Programming/gcc2/gcc/main.c:39
    gcc-mirror#19 0x7ffff6f0de09 in __libc_start_main ../csu/libc-start.c:314
    gcc-mirror#20 0x9eac09 in _start (/home/marxin/Programming/gcc2/objdir/gcc/cc1plus+0x9eac09)

gcc/ChangeLog:

	* ipa-modref.c (merge_call_side_effects): Clear modref_parm_map
	fields in the vector.
kraj pushed a commit to kraj/gcc that referenced this pull request Oct 19, 2020
It fixes:

/home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482:22: runtime error: load of value 255, which is not a valid value for type 'bool'
    #0 0x18e5df3 in modref_tree<int>::merge(modref_tree<int>*, vec<modref_parm_map, va_heap, vl_ptr>*) /home/marxin/Programming/gcc2/gcc/ipa-modref-tree.h:482
    #1 0x18dc180 in ipa_merge_modref_summary_after_inlining(cgraph_edge*) /home/marxin/Programming/gcc2/gcc/ipa-modref.c:1779
    gcc-mirror#2 0x18c1c72 in inline_call(cgraph_edge*, bool, vec<cgraph_edge*, va_heap, vl_ptr>*, int*, bool, bool*) /home/marxin/Programming/gcc2/gcc/ipa-inline-transform.c:492
    gcc-mirror#3 0x4a3589c in inline_small_functions /home/marxin/Programming/gcc2/gcc/ipa-inline.c:2216
    gcc-mirror#4 0x4a3b230 in ipa_inline /home/marxin/Programming/gcc2/gcc/ipa-inline.c:2697
    gcc-mirror#5 0x4a3d902 in execute /home/marxin/Programming/gcc2/gcc/ipa-inline.c:3096
    gcc-mirror#6 0x1edf831 in execute_one_pass(opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2509
    gcc-mirror#7 0x1ee26af in execute_ipa_pass_list(opt_pass*) /home/marxin/Programming/gcc2/gcc/passes.c:2936
    gcc-mirror#8 0x103f31b in ipa_passes /home/marxin/Programming/gcc2/gcc/cgraphunit.c:2700
    gcc-mirror#9 0x103fb40 in symbol_table::compile() /home/marxin/Programming/gcc2/gcc/cgraphunit.c:2777
    gcc-mirror#10 0x104092b in symbol_table::finalize_compilation_unit() /home/marxin/Programming/gcc2/gcc/cgraphunit.c:3022
    gcc-mirror#11 0x235723b in compile_file /home/marxin/Programming/gcc2/gcc/toplev.c:485
    gcc-mirror#12 0x235fff9 in do_compile /home/marxin/Programming/gcc2/gcc/toplev.c:2321
    gcc-mirror#13 0x23605fc in toplev::main(int, char**) /home/marxin/Programming/gcc2/gcc/toplev.c:2460
    gcc-mirror#14 0x4e2b93b in main /home/marxin/Programming/gcc2/gcc/main.c:39
    gcc-mirror#15 0x7ffff6f0ae09 in __libc_start_main ../csu/libc-start.c:314
    gcc-mirror#16 0x9a0be9 in _start (/home/marxin/Programming/gcc2/objdir/gcc/cc1+0x9a0be9)

gcc/ChangeLog:

	* ipa-modref.c (compute_parm_map): Clear vector.
fxcoudert pushed a commit to fxcoudert/gcc that referenced this pull request May 4, 2021
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.
nstester pushed a commit to nstester/gcc that referenced this pull request Jun 14, 2021
The fixed error is:

==21166==ERROR: AddressSanitizer: alloc-dealloc-mismatch (operator new [] vs operator delete) on 0x60300000d900
    #0 0x7367d7 in operator delete(void*, unsigned long) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/libsanitizer/asan/asan_new_delete.cpp:172
    #1 0x3b82e6e in pointer_equiv_analyzer::~pointer_equiv_analyzer() /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/gimple-ssa-evrp.c:161
    #2 0x3b83387 in hybrid_folder::~hybrid_folder() /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/gimple-ssa-evrp.c:517
    #3 0x3b83387 in execute_early_vrp /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/gimple-ssa-evrp.c:686
    #4 0x1790611 in execute_one_pass(opt_pass*) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/passes.c:2567
    gcc-mirror#5 0x1792003 in execute_pass_list_1 /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/passes.c:2656
    gcc-mirror#6 0x1792029 in execute_pass_list_1 /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/passes.c:2657
    gcc-mirror#7 0x179209f in execute_pass_list(function*, opt_pass*) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/passes.c:2667
    gcc-mirror#8 0x178a5f3 in do_per_function_toporder(void (*)(function*, void*), void*) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/passes.c:1773
    gcc-mirror#9 0x1792fac in do_per_function_toporder(void (*)(function*, void*), void*) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/plugin.h:191
    gcc-mirror#10 0x1792fac in execute_ipa_pass_list(opt_pass*) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/passes.c:3001
    gcc-mirror#11 0xc525fc in ipa_passes /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/cgraphunit.c:2154
    gcc-mirror#12 0xc525fc in symbol_table::compile() /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/cgraphunit.c:2289
    gcc-mirror#13 0xc5a096 in symbol_table::compile() /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/cgraphunit.c:2269
    gcc-mirror#14 0xc5a096 in symbol_table::finalize_compilation_unit() /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/cgraphunit.c:2537
    gcc-mirror#15 0x1a7a17c in compile_file /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/toplev.c:482
    gcc-mirror#16 0x69c758 in do_compile /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/toplev.c:2210
    gcc-mirror#17 0x69c758 in toplev::main(int, char**) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/toplev.c:2349
    gcc-mirror#18 0x6a932a in main /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/main.c:39
    gcc-mirror#19 0x7ffff7820b34 in __libc_start_main ../csu/libc-start.c:332
    gcc-mirror#20 0x6aa5fd in _start (/home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/objdir/gcc/cc1+0x6aa5fd)

0x60300000d900 is located 0 bytes inside of 32-byte region [0x60300000d900,0x60300000d920)
allocated by thread T0 here:
    #0 0x735ab7 in operator new[](unsigned long) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/libsanitizer/asan/asan_new_delete.cpp:102
    #1 0x3b82dac in pointer_equiv_analyzer::pointer_equiv_analyzer(gimple_ranger*) /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-asan/build/gcc/gimple-ssa-evrp.c:156

gcc/ChangeLog:

	* gimple-ssa-evrp.c (pointer_equiv_analyzer::~pointer_equiv_analyzer): Use delete[].
mablinov pushed a commit to mablinov/gcc that referenced this pull request Oct 29, 2021
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.
nstester pushed a commit to nstester/gcc that referenced this pull request Nov 5, 2021
For aarch64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11 on the development branch.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Add LTRAMP
	to the list of symbol prefixes that must be made linker-
	visible.
fxcoudert pushed a commit to fxcoudert/gcc that referenced this pull request Nov 23, 2021
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.
nstester pushed a commit to nstester/gcc that referenced this pull request Dec 30, 2021
…imize or target pragmas [PR103012]

The following testcases ICE when an optimize or target pragma
is followed by a long line (4096+ chars).
This is because on such long lines we can't use columns anymore,
but the cpp_define calls performed by c_cpp_builtins_optimize_pragma
or from the backend hooks for target pragma are done on temporary
buffers and expect to get columns from whatever line they appear on
(which happens to be the long line after optimize/target pragma),
and we run into:
 #0  fancy_abort (file=0x3abec67 "../../libcpp/line-map.c", line=502, function=0x3abecfc "linemap_add") at ../../gcc/diagnostic.c:1986
 #1  0x0000000002e7c335 in linemap_add (set=0x7ffff7fca000, reason=LC_RENAME, sysp=0, to_file=0x41287a0 "pr103012.i", to_line=3) at ../../libcpp/line-map.c:502
 #2  0x0000000002e7cc24 in linemap_line_start (set=0x7ffff7fca000, to_line=3, max_column_hint=128) at ../../libcpp/line-map.c:827
 #3  0x0000000002e7ce2b in linemap_position_for_column (set=0x7ffff7fca000, to_column=1) at ../../libcpp/line-map.c:898
 #4  0x0000000002e771f9 in _cpp_lex_direct (pfile=0x40c3b60) at ../../libcpp/lex.c:3592
 gcc-mirror#5  0x0000000002e76c3e in _cpp_lex_token (pfile=0x40c3b60) at ../../libcpp/lex.c:3394
 gcc-mirror#6  0x0000000002e610ef in lex_macro_node (pfile=0x40c3b60, is_def_or_undef=true) at ../../libcpp/directives.c:601
 gcc-mirror#7  0x0000000002e61226 in do_define (pfile=0x40c3b60) at ../../libcpp/directives.c:639
 gcc-mirror#8  0x0000000002e610b2 in run_directive (pfile=0x40c3b60, dir_no=0, buf=0x7fffffffd430 "__OPTIMIZE__ 1\n", count=14) at ../../libcpp/directives.c:589
 gcc-mirror#9  0x0000000002e650c1 in cpp_define (pfile=0x40c3b60, str=0x2f784d1 "__OPTIMIZE__") at ../../libcpp/directives.c:2513
 gcc-mirror#10 0x0000000002e65100 in cpp_define_unused (pfile=0x40c3b60, str=0x2f784d1 "__OPTIMIZE__") at ../../libcpp/directives.c:2522
 gcc-mirror#11 0x0000000000f50685 in c_cpp_builtins_optimize_pragma (pfile=0x40c3b60, prev_tree=<optimization_node 0x7fffea042000>, cur_tree=<optimization_node 0x7fffea042020>)
     at ../../gcc/c-family/c-cppbuiltin.c:600
assertion that LC_RENAME doesn't happen first.

I think the right fix is emit those predefined macros upon
optimize/target pragmas with BUILTINS_LOCATION, like we already do
for those macros at the start of the TU, they don't appear in columns
of the next line after it.  Another possibility would be to force them
at the location of the pragma.

2021-12-30  Jakub Jelinek  <jakub@redhat.com>

	PR c++/103012
gcc/
	* config/i386/i386-c.c (ix86_pragma_target_parse): Perform
	cpp_define/cpp_undef calls with forced token locations
	BUILTINS_LOCATION.
	* config/arm/arm-c.c (arm_pragma_target_parse): Likewise.
	* config/aarch64/aarch64-c.c (aarch64_pragma_target_parse): Likewise.
	* config/s390/s390-c.c (s390_pragma_target_parse): Likewise.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Perform
	cpp_define_unused/cpp_undef calls with forced token locations
	BUILTINS_LOCATION.
gcc/testsuite/
	PR c++/103012
	* g++.dg/cpp/pr103012.C: New test.
	* g++.target/i386/pr103012.C: New test.
kraj pushed a commit to kraj/gcc that referenced this pull request Jan 24, 2022
…imize or target pragmas [PR103012]

The following testcases ICE when an optimize or target pragma
is followed by a long line (4096+ chars).
This is because on such long lines we can't use columns anymore,
but the cpp_define calls performed by c_cpp_builtins_optimize_pragma
or from the backend hooks for target pragma are done on temporary
buffers and expect to get columns from whatever line they appear on
(which happens to be the long line after optimize/target pragma),
and we run into:
 #0  fancy_abort (file=0x3abec67 "../../libcpp/line-map.c", line=502, function=0x3abecfc "linemap_add") at ../../gcc/diagnostic.c:1986
 #1  0x0000000002e7c335 in linemap_add (set=0x7ffff7fca000, reason=LC_RENAME, sysp=0, to_file=0x41287a0 "pr103012.i", to_line=3) at ../../libcpp/line-map.c:502
 gcc-mirror#2  0x0000000002e7cc24 in linemap_line_start (set=0x7ffff7fca000, to_line=3, max_column_hint=128) at ../../libcpp/line-map.c:827
 gcc-mirror#3  0x0000000002e7ce2b in linemap_position_for_column (set=0x7ffff7fca000, to_column=1) at ../../libcpp/line-map.c:898
 gcc-mirror#4  0x0000000002e771f9 in _cpp_lex_direct (pfile=0x40c3b60) at ../../libcpp/lex.c:3592
 gcc-mirror#5  0x0000000002e76c3e in _cpp_lex_token (pfile=0x40c3b60) at ../../libcpp/lex.c:3394
 gcc-mirror#6  0x0000000002e610ef in lex_macro_node (pfile=0x40c3b60, is_def_or_undef=true) at ../../libcpp/directives.c:601
 gcc-mirror#7  0x0000000002e61226 in do_define (pfile=0x40c3b60) at ../../libcpp/directives.c:639
 gcc-mirror#8  0x0000000002e610b2 in run_directive (pfile=0x40c3b60, dir_no=0, buf=0x7fffffffd430 "__OPTIMIZE__ 1\n", count=14) at ../../libcpp/directives.c:589
 gcc-mirror#9  0x0000000002e650c1 in cpp_define (pfile=0x40c3b60, str=0x2f784d1 "__OPTIMIZE__") at ../../libcpp/directives.c:2513
 gcc-mirror#10 0x0000000002e65100 in cpp_define_unused (pfile=0x40c3b60, str=0x2f784d1 "__OPTIMIZE__") at ../../libcpp/directives.c:2522
 gcc-mirror#11 0x0000000000f50685 in c_cpp_builtins_optimize_pragma (pfile=0x40c3b60, prev_tree=<optimization_node 0x7fffea042000>, cur_tree=<optimization_node 0x7fffea042020>)
     at ../../gcc/c-family/c-cppbuiltin.c:600
assertion that LC_RENAME doesn't happen first.

I think the right fix is emit those predefined macros upon
optimize/target pragmas with BUILTINS_LOCATION, like we already do
for those macros at the start of the TU, they don't appear in columns
of the next line after it.  Another possibility would be to force them
at the location of the pragma.

2021-12-30  Jakub Jelinek  <jakub@redhat.com>

	PR c++/103012
gcc/
	* config/i386/i386-c.c (ix86_pragma_target_parse): Perform
	cpp_define/cpp_undef calls with forced token locations
	BUILTINS_LOCATION.
	* config/arm/arm-c.c (arm_pragma_target_parse): Likewise.
	* config/aarch64/aarch64-c.c (aarch64_pragma_target_parse): Likewise.
	* config/s390/s390-c.c (s390_pragma_target_parse): Likewise.
gcc/c-family/
	* c-cppbuiltin.c (c_cpp_builtins_optimize_pragma): Perform
	cpp_define_unused/cpp_undef calls with forced token locations
	BUILTINS_LOCATION.
gcc/testsuite/
	PR c++/103012
	* g++.dg/cpp/pr103012.C: New test.
	* g++.target/i386/pr103012.C: New test.

(cherry picked from commit 1dbe26b)
catap pushed a commit to catap/gcc that referenced this pull request Feb 22, 2022
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.

(cherry picked from commit 717057366d780cc3f54d5621e78334a3e63789d0)
kraj pushed a commit to kraj/gcc that referenced this pull request Apr 14, 2022
For aarch64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11 on the development branch.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Add LTRAMP
	to the list of symbol prefixes that must be made linker-
	visible.

(cherry picked from commit f1e2879)
kraj pushed a commit to kraj/gcc that referenced this pull request May 29, 2022
For aarch64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11 on the development branch.

Signed-off-by: Iain Sandoe <iain@sandoe.co.uk>

gcc/ChangeLog:

	* config/darwin.h (ASM_GENERATE_INTERNAL_LABEL): Add LTRAMP
	to the list of symbol prefixes that must be made linker-
	visible.

(cherry picked from commit f1e2879)
catap pushed a commit to catap/gcc that referenced this pull request May 3, 2023
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.

(cherry picked from commit 717057366d780cc3f54d5621e78334a3e63789d0)
catap pushed a commit to catap/gcc that referenced this pull request May 3, 2023
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.

(cherry picked from commit 717057366d780cc3f54d5621e78334a3e63789d0)
catap pushed a commit to catap/gcc that referenced this pull request May 3, 2023
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.

(cherry picked from commit 717057366d780cc3f54d5621e78334a3e63789d0)
catap pushed a commit to catap/gcc that referenced this pull request May 3, 2023
For Arm64, the alignment of the LTRAMPn symbols matters.

Actually, the LTRAMPn  symbols _are_ 8 byte aligned, but because
they are Local, the linker doesn't know that this guarantee can be met.
It assumes that they are not necessarily more aligned than the
containing section (ld64 atoms strike again).

The fix is to publish the trampoline symbol for the linker to access
directly - it can then see that the atom is suitably aligned.

Fixes issue gcc-mirror#11.

(cherry picked from commit 717057366d780cc3f54d5621e78334a3e63789d0)
NinaRanns referenced this pull request in NinaRanns/gcc Jul 3, 2024
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant