H.J. Lu [Wed, 17 Dec 2014 14:22:57 +0000 (14:22 +0000)]
Add -malign-data={abi|compat|cachineline}
Add -malign-data={abi|compat,cachineline} to control how GCC aligns
variables. "compat" uses increased alignment value compatible with
GCC 4.8 and earlier, "abi" uses alignment value as specified by the
psABI, and "cacheline" uses increased alignment value to match the
cache line size. "compat" is the default.
gcc/
PR target/61296
* config/i386/i386-opts.h (ix86_align_data): New enum.
* config/i386/i386.c (ix86_data_alignment): Return the ABI
alignment value for -malign-data=abi, the cachine line size
for -malign-data=cachineline and the older GCC compatible
alignment value for for -malign-data=compat.
* config/i386/i386.opt (malign-data=): New.
* doc/invoke.texi: Document -malign-data=.
Jakub Jelinek [Wed, 17 Dec 2014 09:29:12 +0000 (10:29 +0100)]
re PR tree-optimization/64322 (More optimize opportunity for constant folding)
PR tree-optimization/64322
* tree-vrp.c (extract_range_from_binary_expr_1): Attempt to derive
range for RSHIFT_EXPR even if vr0 range is not VR_RANGE or is symbolic.
Jakub Jelinek [Wed, 17 Dec 2014 09:26:49 +0000 (10:26 +0100)]
re PR sanitizer/64289 (ICE with -fsanitize=float-cast-overflow)
PR sanitizer/64289
* c-convert.c: Include ubsan.h.
(convert): For real -> integral casts and
-fsanitize=float-cast-overflow don't call convert_to_integer, but
instead instrument the float cast directly.
Ian Lance Taylor [Tue, 16 Dec 2014 22:53:38 +0000 (22:53 +0000)]
compiler: Don't built hash/equality functions for thunk structs.
They are never necessary, and they can cause problems when a
thunk is used to pass an unexported type from a different
package to a function defined in that package. The resulting
struct type may need to call the comparison routine from the
other package, which will fail because the type is not
exported. This will be bug492 in the master testsuite.
Jan Hubicka [Tue, 16 Dec 2014 22:16:17 +0000 (23:16 +0100)]
ipa-inline-analysis.c (will_be_nonconstant_predicate): Consider return values of const calls as constants.
* ipa-inline-analysis.c (will_be_nonconstant_predicate): Consider
return values of const calls as constants.
(estimate_function_body_sizes): Expect calls to have false predicates.
Oleg Endo [Tue, 16 Dec 2014 21:28:59 +0000 (21:28 +0000)]
re PR target/53513 ([SH] Add support for fpchg insn and improve fenv support)
gcc/testsuite/
PR target/53513
* gcc.target/sh/fpchg.c: Rename to ...
* gcc.target/sh/pr53513-1.c: ... this. Adjust test case to work for
-m4a and -m4a-single.
* genmatch.c (parser::parser): Initialize capture_ids.
(parser::parse_pattern): Properly allocate capture_ids before
using them. Set capture_ids to zero when its lifetime is
supposed to finish.
(parser::parse_simplify): Allocate capture_ids only if
required.
Janus Weil [Tue, 16 Dec 2014 08:15:38 +0000 (09:15 +0100)]
re PR fortran/64244 (ICE at class.c:236 when using non_overridable)
2014-12-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/64244
* resolve.c (resolve_typebound_call): New argument to pass out the
non-overridable attribute of the specific procedure.
(resolve_typebound_subroutine): Get overridable flag from
resolve_typebound_call.
Uros Bizjak [Tue, 16 Dec 2014 07:49:53 +0000 (08:49 +0100)]
gnu-user.h (TARGET_CAN_SPLIT_STACK): Move from here ...
* config/i386/gnu-user.h (TARGET_CAN_SPLIT_STACK): Move from here ...
* config/i386/gnu-user64.h (TARGET_CAN_SPLIT_STACK): ... and here ...
* config/i386/gnu-user-common.h (TARGET_CAN_SPLIT_STACK): ... to here.
Jakub Jelinek [Mon, 15 Dec 2014 20:10:45 +0000 (21:10 +0100)]
re PR rtl-optimization/64316 (ICE in simplify_const_unary_operation after r218503)
PR rtl-optimization/64316
* simplify-rtx.c (simplify_relational_operation_1): For
(eq/ne (and x y) x) and (eq/ne (and x y) y) optimizations use
CONST0_RTX instead of const0_rtx.
* ira-int.h (ira_prohibited_class_mode_regs): Remove.
(struct target_ira_int): Move x_ira_prohibited_class_mode_regs to
...
* ira.h (struct target_ira_int): ... here.
(ira_prohibited_class_mode_regs): Define.
* lra-constraints.c (process_alt_operands): Add one more condition
to refuse alternative when reload pseudo of given class can not
hold value of given mode.
Steven Bosscher [Mon, 15 Dec 2014 18:37:59 +0000 (18:37 +0000)]
re PR fortran/61669 (Error recovery ICE)
PR fortran/61669
* gfortran.h (struct gfc_namespace): Add OLD_DATA field.
* decl.c (gfc_reject_data): New function.
* parse.c *use_modules): Record roll-back point.
(next_statement): Likewise.
(reject_statement): Roll back to last accepted DATA.
* gfortran.dg/pr61669.f90: New test.
Co-Authored-By: Jakub Jelinek <jakub@redhat.com>
From-SVN: r218757
Richard Biener [Mon, 15 Dec 2014 18:33:16 +0000 (18:33 +0000)]
re PR tree-optimization/64312 (ICE: Segmentation fault)
2014-12-15 Richard Biener <rguenther@suse.de>
PR tree-optimization/64312
* tree-ssa-sccvn.c (vn_reference_lookup_pieces): Use
vuse_ssa_val as callback to walk_non_aliased_vuses.
(vn_reference_lookup): Likewise.
Jason Merrill [Mon, 15 Dec 2014 18:31:40 +0000 (13:31 -0500)]
N3778: Sized Deallocation
N3778: Sized Deallocation
gcc/c-family/
* c.opt (-fsized-deallocation, -Wc++14-compat): New.
(-Wsized-deallocation): New.
* c-opts.c (c_common_post_options): -fsized-deallocation defaults
to on in C++14 and up.
gcc/cp/
* call.c (non_placement_deallocation_fn_p): A global sized
operator delete is not a usual deallocation function until C++14.
(build_op_delete_call): Choose the global sized op delete if we
know the size.
* cp-tree.h: Declare non_placement_deallocation_fn_p.
(enum cp_tree_index): Remove CPTI_GLOBAL_DELETE_FNDECL.
(global_delete_fndecl): Remove.
* decl.c (cxx_init_decl_processing): Also declare sized op deletes.
(grok_op_properties): Warn about sized dealloc without the flag.
* init.c (build_builtin_delete_call): Remove.
(build_vec_delete_1, build_delete): Don't call it.
* decl2.c (maybe_warn_sized_delete): New.
(cp_write_global_declarations): Call it.
libstdc++-v3/
* libsupc++/del_ops.cc: New.
* libsupc++/del_opvs.cc: New.
* libsupc++/Makefile.am: Add them.
* libsupc++/Makefile.in: Regenerate.
* config/abi/pre/gnu.ver: Export _ZdlPvm and _ZdaPvm.
Jakub Jelinek [Mon, 15 Dec 2014 10:50:52 +0000 (11:50 +0100)]
re PR target/64210 (FAIL: gcc.target/i386/avx512vl-(vmovdqa64|vpbroadcastd)-1.c ... with -fpic)
PR target/64210
* gcc.target/i386/avx512f-broadcast-gpr-1.c: Use %(?:e|r\[0-9\]+d)
instead of %e in regexps trying to match 32-bit GPR.
* gcc.target/i386/avx512f-vpbroadcastd-1.c: Likewise.
* gcc.target/i386/avx512vl-vpbroadcastd-1.c: Likewise.
* gcc.target/i386/avx512vl-vmovdqa64-1.c: Restrict some scan-assembler-times
lines to nonpic targets only. Fix up \[^\n^x^y\] to \[^\nxy\].
Jakub Jelinek [Mon, 15 Dec 2014 09:37:47 +0000 (10:37 +0100)]
re PR sanitizer/64265 (r217669 broke tsan)
PR sanitizer/64265
* tsan.c (instrument_func_entry): Insert __tsan_func_entry
call on edge from entry block to single succ instead
of after labels of single succ of entry block.
Jan Hubicka [Mon, 15 Dec 2014 06:19:51 +0000 (07:19 +0100)]
re PR ipa/61602 (ICE in lto1 on x86_64-linux-gnu in ipa_single_use, at ipa.c:1257)
PR ipa/61602
* gcc.dg/torture/pr61602.c: New testcase.
* cgraph.h (ipa_discover_readonly_nonaddressable_vars): Return bool.
* ipa.c (set_writeonly_bit): Track if reference was removed.
(ipa_discover_readonly_nonaddressable_vars): Return true if any
references was removed.
* ipa-reference.c (propagate): Return TODO_remove_functions if
reference was removed.
Jan Hubicka [Mon, 15 Dec 2014 03:44:58 +0000 (04:44 +0100)]
re PR middle-end/61558 (ICE: Segmentation fault)
PR ipa/61558
* symtab.c (symbol_table::insert_to_assembler_name_hash
symbol_table::unlink_from_assembler_name_hash): Do not ICE when
DECL_ASSEMBLER_NAME is NULL.
Janus Weil [Sun, 14 Dec 2014 12:04:49 +0000 (13:04 +0100)]
re PR fortran/63674 ([F03] procedure pointer and non/pure procedure)
2014-12-14 Janus Weil <janus@gcc.gnu.org>
PR fortran/63674
* resolve.c (pure_function): Treat procedure-pointer components.
(check_pure_function): New function.
(resolve_function): Use it.
(pure_subroutine): Return a bool to indicate success and modify
arguments.
(resolve_generic_s0,resolve_specific_s0,resolve_unknown_s): Use return
value of 'pure_subroutine'.
(resolve_ppc_call): Call 'pure_subroutine'.
(resolve_expr_ppc): Call 'check_pure_function'.
Jakub Jelinek [Sat, 13 Dec 2014 11:24:37 +0000 (12:24 +0100)]
re PR bootstrap/64023 (r216964 breaks bootstrap on darwin when using gcc as the bootstrap compiler.)
PR bootstrap/64023
* Makefile.tpl (EXTRA_TARGET_FLAGS): Set STAGE1_LDFLAGS
to POSTSTAGE1_LDFLAGS and STAGE1_LIBS to POSTSTAGE1_LIBS.
Add -B to libstdc++-v3/src/.libs and libstdc++-v3/libsupc++/.libs
to CXX.
* Makefile.in: Regenerated.
Ian Lance Taylor [Sat, 13 Dec 2014 00:52:20 +0000 (00:52 +0000)]
runtime: Clear stack pointers for extra G's.
Fix an unusual C to Go callback case. Newly created C threads
call into Go code, forcing the Go code to allocate new M and G
structures. While executing Go code, the stack is split. The
Go code then returns. Returning from a Go callback is treated
as entering a system call, so the G gcstack field is set to
point to the Go stack. In this case, though, we were called
from a newly created C thread, so we drop the extra M and G
structures. The C thread then exits.
Then a new C thread calls into Go code, reusing the previously
created M and G. The Go code requires a larger stack frame,
causing the old stack segment to be unmapped and a new stack
segment allocated. At this point the gcstack field is
pointing to the old stack segment.
Then a garbage collection occurs. The garbage collector sees
that the gcstack field is not nil, so it scans it as the first
stack segment. Unfortunately it points to memory that was
unmapped. So the program crashes.
The fix is simple: when handling extra G structures created
for callbacks from new C threads, clear the gcstack field.