Fix three issues in ipa-prop
Hi, Chromium LTO build ICEs on bogus get_binfo_at_offset call. This is caused by updating pasto bug in update_jump_functions_after_inlining. While looking for it I noticed we have other issues here. In particular, when combining -fno-devirtualize and -fdevirtualize units, we get all jump fuctions as type preserved. This is because detect_type_change returns false when it decides detection is not needed. It really should return true. Otherwise we will end up propagating invalid types through the -fno-devirtualize function and produce wrong code at LTO. I also added some sanity checking to jump functions while hunting the bug that uncovered another problem in compute_complex_assign_jump_func and compute_complex_ancestor_jump_func that are still confusing type of parameter (that is pointer) to type of object passed by reference. I also made us to not save the type to ipa_set_ancestor_jf when type is not preserved, since it will never be used for enything useful. ipa_get_jf_ancestor_result uses to build it the updated address, but we can safely use pointer_type_node, because it will be converted at the substitution time anyway. Bootstrapped/regtested x86_64-linux, will commit it tomorrow after some furhter testing and unless Martin stops me ;) Honza * ipa-cp.c (ipa_get_jf_ancestor_result): Allow type to be NULL. * ipa-prop.c (ipa_set_jf_known_type): Do not set anyting when we do not devirtualize. (ipa_set_ancestor_jf): Likewise; do not record type when we do not devirtualize. (detect_type_change): Signalize type change when giving up on detection. (compute_complex_assign_jump_func): Fix call of ipa_set_ancestor_jf. (compute_complex_ancestor_jump_func): Likewise. (update_jump_functions_after_inlining): Fix combining of PASS_THROUGH and KNOWN_TYPE. Index: ipa-cp.c === --- ipa-cp.c(revision 207817) +++ ipa-cp.c(working copy) @@ -798,7 +798,9 @@ ipa_get_jf_ancestor_result (struct ipa_j tree t = TREE_OPERAND (input, 0); t = build_ref_for_offset (EXPR_LOCATION (t), t, ipa_get_jf_ancestor_offset (jfunc), - ipa_get_jf_ancestor_type (jfunc), NULL, false); + ipa_get_jf_ancestor_type (jfunc) + ? ipa_get_jf_ancestor_type (jfunc) + : ptr_type_node, NULL, false); return build_fold_addr_expr (t); } else Index: ipa-prop.c === --- ipa-prop.c (revision 207817) +++ ipa-prop.c (working copy) @@ -393,6 +393,9 @@ ipa_set_jf_known_type (struct ipa_jump_f { gcc_assert (TREE_CODE (component_type) == RECORD_TYPE && TYPE_BINFO (component_type)); + if (!flag_devirtualize) +return; + gcc_assert (BINFO_VTABLE (TYPE_BINFO (component_type))); jfunc->type = IPA_JF_KNOWN_TYPE; jfunc->value.known_type.offset = offset, jfunc->value.known_type.base_type = base_type; @@ -477,10 +480,16 @@ ipa_set_ancestor_jf (struct ipa_jump_fun tree type, int formal_id, bool agg_preserved, bool type_preserved) { + if (!flag_devirtualize) +type_preserved = false; + gcc_assert (!type_preserved + || (TREE_CODE (type) == RECORD_TYPE + && TYPE_BINFO (type) + && BINFO_VTABLE (TYPE_BINFO (type; jfunc->type = IPA_JF_ANCESTOR; jfunc->value.ancestor.formal_id = formal_id; jfunc->value.ancestor.offset = offset; - jfunc->value.ancestor.type = type; + jfunc->value.ancestor.type = type_preserved ? type : NULL; jfunc->value.ancestor.agg_preserved = agg_preserved; jfunc->value.ancestor.type_preserved = type_preserved; } @@ -686,7 +695,7 @@ detect_type_change (tree arg, tree base, || TREE_CODE (comp_type) != RECORD_TYPE || !TYPE_BINFO (comp_type) || !BINFO_VTABLE (TYPE_BINFO (comp_type))) -return false; +return true; /* C++ methods are not allowed to change THIS pointer unless they are constructors or destructors. */ @@ -1103,7 +1112,7 @@ compute_complex_assign_jump_func (struct bool type_p = !detect_type_change (op1, base, TREE_TYPE (param_type), call, jfunc, offset); if (type_p || jfunc->type == IPA_JF_UNKNOWN) eg ipa_set_ancestor_jf (jfunc, offset, TREE_TYPE (op1), index, + ipa_set_ancestor_jf (jfunc, offset, TREE_TYPE (param_type), index, parm_ref_data_pass_through_p (&parms_ainfo[index], call, ssa), type_p); } @@ -1235,7 +1244,7 @@ compute_complex_ancestor_jump_func (stru type_p = !detect_type_change (obj, expr, TREE_TYPE (param_type), call, jfunc, offset); if (type_p || jfunc->type
Re: [RFA][rtl-optimization/52714] Do not allow combine to create invalid RTL
> So, the code has this structure > > if (looks safe) >emit in existing order > else if (reverse order looks safe) >emit in reversed order > else >undo_all > > > In this specific case, the existing order is never going to look safe > because set1 uses (sp) as an input argument and use_crosses_set_p is > very conservative when the value is the stack pointer on a PUSH_ROUNDING > machine (such as the m68k) What a bummer, it seems all things are aligned so as to block the optimization here... It is a bit of a shame, as this is a powerful combination that would eliminate a branch if it succeeded. The combination of the 3 insns yields the (set (pc) (pc)) pattern and it's only because added_sets_1 is true that the annoying PARALLEL is created. > So we could put the verification code that both I3 and I2 are INSNs in > the else if (reverse order looks safe) clause.That would mean for > this testcase, we ultimately undo_all. But I consider that reasonable > given the only reason this instance bled into RTL land was -O1 instead > of -O2 compilation. Although it's probably time to concede defeat in this particular case, I don't think we should use the NONJUMP_INSN_P big hammer because we want to eliminate branches if possible. So I'd just add the minimal test to the two existing conditions so as to prevent the invalid RTL from being created, e.g. && (!JUMP_P (i3) || SET_DEST (set[01]) == pc_rtx) -- Eric Botcazou
[patch] Fix assertion failure in compute_complex_ancestor_jump_func
Hi, this is a regression present on all active branches. The following assertion triggers in compute_complex_ancestor_jump_func: index = ipa_get_param_decl_index (info, SSA_NAME_VAR (parm)); gcc_assert (index >= 0); because the PARM_DECL is the static_chain_decl so the returned index is -1. It seems to me that this assertion is overzealous: in many other places, the code explicitly tests for the non-negativity of index and returns otherwise. Hence the proposed fix, tested on x86_64-suse-linux, OK for all branches? 2014-02-17 Eric Botcazou * ipa-prop.c (compute_complex_ancestor_jump_func): Replace overzealous assertion with conditional return. 2014-02-17 Eric Botcazou * gnat.dg/opt32.adb: New test. -- Eric BotcazouIndex: ipa-prop.c === --- ipa-prop.c (revision 207796) +++ ipa-prop.c (working copy) @@ -1211,7 +1211,8 @@ compute_complex_ancestor_jump_func (stru return; parm = TREE_OPERAND (expr, 0); index = ipa_get_param_decl_index (info, SSA_NAME_VAR (parm)); - gcc_assert (index >= 0); + if (index < 0) +return; cond_bb = single_pred (assign_bb); cond = last_stmt (cond_bb);-- { dg-do compile } -- { dg-options "-O2" } with Ada.Containers; use Ada.Containers; with Ada.Containers.Vectors; function Opt32 return Natural is package My_Vectors is new Vectors (Index_Type => Natural, Element_Type => Integer); use My_Vectors; V : Vector; function Sign_Changes return Natural is Cur : Cursor := To_Cursor (V, 0); R: Natural := 0; Negative : Boolean; begin Negative := Element (Cur) < 0; loop Cur := Next (Cur); exit when R > 100; if (Element (Cur) < 0) /= Negative then Negative := not Negative; R := R + 1; end if; end loop; return R; end; begin return Sign_Changes; end;
Re: [patch] Fix wrong code with VCE to bit-field type at -O
> There is nothing obvious I think, i.e. that's debatable. I agree that a VCE > from a 32-bit object to a 32-bit integer with 24-bit precision should not > clear the upper 8 bits (so the REDUCE_BIT_FIELD part of my patch is wrong). > But here we have a VCE from a 24-bit object to a 32-bit integer with 24-bit > precision which reads *more bits* than the size of the source type; that I > think is plain wrong and is fixed by the bit-field extraction in the patch. Revised patch along these lines attached. Although I agree that it's a bit of a kludge, it's quite localized and plausible IMO. * expr.c (expand_expr_real_1) : For a bit-field destination type, extract exactly the number of valid bits if the source type isn't integral or has a different precision. -- Eric BotcazouIndex: expr.c === --- expr.c (revision 207796) +++ expr.c (working copy) @@ -10458,15 +10458,21 @@ expand_expr_real_1 (tree exp, rtx target op0 = target; } - /* At this point, OP0 is in the correct mode. If the output type is + /* If OP0 is a MEM without the correct mode and we need to reduce it to + a bit-field type, do an extraction. Otherwise, we can read all bits + of MODE but need to deal with the alignment. If the output type is such that the operand is known to be aligned, indicate that it is. - Otherwise, we need only be concerned about alignment for non-BLKmode - results. */ + Otherwise, we actually need only be concerned about alignment for + non-BLKmode results. */ if (MEM_P (op0)) { enum insn_code icode; - if (TYPE_ALIGN_OK (type)) + if (reduce_bit_field && GET_MODE (op0) != mode) + return extract_bit_field (op0, TYPE_PRECISION (type), 0, + TYPE_UNSIGNED (type), NULL_RTX, + mode, mode); + else if (TYPE_ALIGN_OK (type)) { /* ??? Copying the MEM without substantially changing it might run afoul of the code handling volatile memory references in
Added myself to MAINTAINERS (Write After Approval)
2014-02-17 Kugan Vivekanandarajah Index: MAINTAINERS === --- MAINTAINERS (revision 207819) +++ MAINTAINERS (working copy) @@ -551,6 +551,7 @@ David Ung dav...@mips.com Neil Vachharajani nvach...@gmail.com Kris Van Hees kris.van.h...@oracle.com +Kugan Vivekanandarajah kug...@linaro.org Tom de Vries t...@codesourcery.com Nenad Vukicevicne...@intrepid.com Feng Wang fengw...@nudt.edu.cn
Re: [Patch, Fortran, Regression] PR 55907: ICE with -fno-automatic -finit-local-zero
Dear Janus, This is OK for trunk, 4.8 and 4.7. Thanks for the patch. Paul On 16 February 2014 23:11, Janus Weil wrote: > Hi all, > > here is a small patch for a ICE-on-valid regression. Regtested on > x86_64-unknown-linux-gnu. Ok for trunk/4.8/4.7? > > Cheers, > Janus > > > 2014-02-16 Janus Weil > > PR fortran/55907 > * resolve.c (build_default_init_expr): Don't initialize character > variable if -fno-automatic is given. > > > 2014-02-16 Janus Weil > > PR fortran/55907 > * gfortran.dg/init_flag_12.f90: New. -- The knack of flying is learning how to throw yourself at the ground and miss. --Hitchhikers Guide to the Galaxy
Re: [PATCH] Fixing SEH exceptions for languages != C++
Am 16.02.2014 um 16:47 schrieb Mike Stump : > On Feb 15, 2014, at 9:27 AM, Jonathan Schleifer wrote: >> The following patch fixes a bug in SEH exception handling that made it >> crash with ObjC > > From an ObjC perspective, I’m fine with the work; though, an seh person needs > to weigh in. I’m fine with the back port as well. Is there anybody specific whom I should ping, like a maintainer for SEH exceptions in GCC? -- Jonathan
[Testsuite] Skip torture/pr60183.c for AVR target
The newly added gcc.dg/torture/pr60183.c test fails for the AVR target with an "array size too large" error. This patch marks the test as unsupported for AVR, following the example of other such tests in the testsuite. If ok, could someone apply please? I don't have commit access. Regards Senthil gcc/testsuite/ChangeLog 2014-02-17 Senthil Kumar Selvaraj * gcc.dg/torture/pr60183.c: Skip for avr target. diff --git gcc/testsuite/gcc.dg/torture/pr60183.c gcc/testsuite/gcc.dg/torture/pr60183.c index d37b4b8..8e519dc 100644 --- gcc/testsuite/gcc.dg/torture/pr60183.c +++ gcc/testsuite/gcc.dg/torture/pr60183.c @@ -1,4 +1,5 @@ /* { dg-do run } */ +/* { dg-skip-if "Size of array too big" { "avr-*-*" } { "*" } { "" } } */ /* Large so an out-of-bound read will crash. */ unsigned char c[0x30001] = { 1 };
Re: [patch] Fix assertion failure in compute_complex_ancestor_jump_func
On Mon, Feb 17, 2014 at 11:13 AM, Eric Botcazou wrote: > Hi, > > this is a regression present on all active branches. The following assertion > triggers in compute_complex_ancestor_jump_func: > > index = ipa_get_param_decl_index (info, SSA_NAME_VAR (parm)); > gcc_assert (index >= 0); > > because the PARM_DECL is the static_chain_decl so the returned index is -1. > It seems to me that this assertion is overzealous: in many other places, the > code explicitly tests for the non-negativity of index and returns otherwise. > > Hence the proposed fix, tested on x86_64-suse-linux, OK for all branches? Ok. [makes me wonder if we should apply propagation to the static chain and a possibly pointer call 'fn' as well] Thanks, Richard. > 2014-02-17 Eric Botcazou > > * ipa-prop.c (compute_complex_ancestor_jump_func): Replace overzealous > assertion with conditional return. > > > 2014-02-17 Eric Botcazou > > * gnat.dg/opt32.adb: New test. > > > -- > Eric Botcazou
Re: [Testsuite] Skip torture/pr60183.c for AVR target
Senthil Kumar Selvaraj writes: > The newly added gcc.dg/torture/pr60183.c test fails for the AVR target > with an "array size too large" error. This patch marks the test as > unsupported for AVR, following the example of other such tests in the > testsuite. [...] > diff --git gcc/testsuite/gcc.dg/torture/pr60183.c > gcc/testsuite/gcc.dg/torture/pr60183.c > index d37b4b8..8e519dc 100644 > --- gcc/testsuite/gcc.dg/torture/pr60183.c > +++ gcc/testsuite/gcc.dg/torture/pr60183.c > @@ -1,4 +1,5 @@ > /* { dg-do run } */ > +/* { dg-skip-if "Size of array too big" { "avr-*-*" } { "*" } { "" } } */ Please omit the last two default args to dg-skip-if. Besides, I don't like explicitly listing targets here. We should have an effective-target keyword for this issue. Rainer -- - Rainer Orth, Center for Biotechnology, Bielefeld University
Re: Fix PR libffi/60073
> This adds proper variadic support to the SPARC port of libffi, thus fixing a > regression in the testsuite in 64-bit mode, and fixes a small inaccuracy in > the documentation. Follow-up patch attached. It renames the existing FFI_V9 into FFI_COMPAT_V9 and defines a new FFI_V9 value. In order to avoid disturbing the V8 part, the new field is only added for V9, which means that more code is compiled only for SPARC64, hence some internal re-shuffling. Tested on SPARC/Solaris and SPARC64/Solaris, both in a regular setup and in a mixed GCC 4.8/mainline setup, applied on the mainline. 2014-02-17 Eric Botcazou PR libffi/60073 * src/sparc/v8.S: Assemble only if !SPARC64. * src/sparc/v9.S: Remove obsolete comment. * src/sparc/ffitarget.h (enum ffi_abi): Add FFI_COMPAT_V9. (V8_ABI_P): New macro. (V9_ABI_P): Likewise. (FFI_EXTRA_CIF_FIELDS): Define only if SPARC64. * src/sparc/ffi.c (ffi_prep_args_v8): Compile only if !SPARC64. (ffi_prep_args_v9): Compile only if SPARC64. (ffi_prep_cif_machdep_core): Use V9_ABI_P predicate. (ffi_prep_cif_machdep): Guard access to nfixedargs field. (ffi_prep_cif_machdep_var): Likewise. (ffi_v9_layout_struct): Compile only if SPARC64. (ffi_call): Deal with FFI_V8PLUS and FFI_COMPAT_V9 and fix warnings. (ffi_prep_closure_loc): Use V9_ABI_P and V8_ABI_P predicates. (ffi_closure_sparc_inner_v8): Compile only if !SPARC64. (ffi_closure_sparc_inner_v9): Compile only if SPARC64. Guard access to nfixedargs field. -- Eric BotcazouIndex: src/sparc/v9.S === --- src/sparc/v9.S (revision 207796) +++ src/sparc/v9.S (working copy) @@ -1,6 +1,6 @@ /* --- v9.S - Copyright (c) 2000, 2003, 2004, 2008 Red Hat, Inc. - + SPARC 64-bit Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining @@ -29,8 +29,6 @@ #include #ifdef SPARC64 -/* Only compile this in for 64bit builds, because otherwise the object file - will have inproper architecture due to used instructions. */ #define STACKFRAME 176 /* Minimum stack framesize for SPARC 64-bit */ #define STACK_BIAS 2047 Index: src/sparc/ffitarget.h === --- src/sparc/ffitarget.h (revision 207796) +++ src/sparc/ffitarget.h (working copy) @@ -48,6 +48,8 @@ typedef enum ffi_abi { FFI_FIRST_ABI = 0, FFI_V8, FFI_V8PLUS, + /* See below for the COMPAT_V9 rationale. */ + FFI_COMPAT_V9, FFI_V9, FFI_LAST_ABI, #ifdef SPARC64 @@ -58,8 +60,19 @@ typedef enum ffi_abi { } ffi_abi; #endif +#define V8_ABI_P(abi) ((abi) == FFI_V8 || (abi) == FFI_V8PLUS) +#define V9_ABI_P(abi) ((abi) == FFI_COMPAT_V9 || (abi) == FFI_V9) + #define FFI_TARGET_SPECIFIC_VARIADIC 1 + +/* The support of variadic functions was broken in the original implementation + of the FFI_V9 ABI. This has been fixed by adding one extra field to the + CIF structure (nfixedargs field), which means that the ABI of libffi itself + has changed. In order to support applications using the original ABI, we + have renamed FFI_V9 into FFI_COMPAT_V9 and defined a new FFI_V9 value. */ +#ifdef SPARC64 #define FFI_EXTRA_CIF_FIELDS unsigned int nfixedargs +#endif /* Definitions for closures - */ Index: src/sparc/ffi.c === --- src/sparc/ffi.c (revision 207796) +++ src/sparc/ffi.c (working copy) @@ -1,7 +1,7 @@ /* --- ffi.c - Copyright (c) 2011 Anthony Green Copyright (c) 1996, 2003-2004, 2007-2008 Red Hat, Inc. - + SPARC Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining @@ -34,93 +34,10 @@ /* ffi_prep_args is called by the assembly routine once stack space has been allocated for the function's arguments */ -void ffi_prep_args_v8(char *stack, extended_cif *ecif) -{ - int i; - void **p_argv; - char *argp; - ffi_type **p_arg; - - /* Skip 16 words for the window save area */ - argp = stack + 16*sizeof(int); - - /* This should only really be done when we are returning a structure, - however, it's faster just to do it all the time... - - if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) */ - *(int *) argp = (long)ecif->rvalue; - - /* And 1 word for the structure return value. */ - argp += sizeof(int); - -#ifdef USING_PURIFY - /* Purify will probably complain in our assembly routine, unless we - zero out this memory. */ - - ((int*)argp)[0] = 0; - ((int*)argp)[1] = 0; - ((int*)argp)[2] = 0; - ((int*)argp)[3] = 0; - ((int*)argp)[4] = 0; - ((int*)argp)[5] = 0; -#endif - - p_argv = ecif->avalue; - -
Re: [PATCH i386 13/8] [AVX-512] Fix argument order for perm and recp intrinsics.
Hello Uroš, On 13 Feb 18:25, Uros Bizjak wrote: > On Thu, Feb 13, 2014 at 1:55 PM, Uros Bizjak wrote: > > >> > >> Please don't change srcp pattern, it should be defined similar to > >> vrcpss (aka sse_vmrcpv4sf). You need to switch operand order > >> elsewhere. > > > > No, you are correct. Operands should be swapped as in your patch. > > Eh, sorry that after some more thinking, I have to again revert this decision. > > The srcp pattern should remain as is, and you should swap operands in > avx512fintrin.h instead: In the bottom there's updated patch. Added "sse" type. mem operand made second. Built-ins & tests fixed. Testing in progress. Is it ok for mainline if pass? -- Thanks, K --- gcc/config/i386/sse.md| 19 --- gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-2.c | 11 ++- gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-2.c | 11 ++- gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28sd-2.c | 11 ++- gcc/testsuite/gcc.target/i386/avx512er-vrsqrt28ss-2.c | 11 ++- gcc/testsuite/gcc.target/i386/avx512f-vrcp14sd-2.c| 4 ++-- gcc/testsuite/gcc.target/i386/avx512f-vrcp14ss-2.c| 8 7 files changed, 42 insertions(+), 33 deletions(-) diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md index 5595767..3d360a0 100644 --- a/gcc/config/i386/sse.md +++ b/gcc/config/i386/sse.md @@ -1456,12 +1456,12 @@ [(set (match_operand:VF_128 0 "register_operand" "=v") (vec_merge:VF_128 (unspec:VF_128 - [(match_operand:VF_128 1 "nonimmediate_operand" "vm")] + [(match_operand:VF_128 2 "nonimmediate_operand" "vm")] UNSPEC_RCP14) - (match_operand:VF_128 2 "register_operand" "v") + (match_operand:VF_128 1 "register_operand" "v") (const_int 1)))] "TARGET_AVX512F" - "vrcp14\t{%1, %2, %0|%0, %2, %1}" + "vrcp14\t{%2, %1, %0|%0, %1, %2}" [(set_attr "type" "sse") (set_attr "prefix" "evex") (set_attr "mode" "")]) @@ -12804,6 +12804,7 @@ "TARGET_AVX512ER" "vexp2\t{%1, %0|%0, %1}" [(set_attr "prefix" "evex") + (set_attr "type" "sse") (set_attr "mode" "")]) (define_insn "avx512er_rcp28" @@ -12814,20 +12815,22 @@ "TARGET_AVX512ER" "vrcp28\t{%1, %0|%0, %1}" [(set_attr "prefix" "evex") + (set_attr "type" "sse") (set_attr "mode" "")]) (define_insn "avx512er_vmrcp28" [(set (match_operand:VF_128 0 "register_operand" "=v") (vec_merge:VF_128 (unspec:VF_128 - [(match_operand:VF_128 1 "" "")] + [(match_operand:VF_128 2 "" "")] UNSPEC_RCP28) - (match_operand:VF_128 2 "register_operand" "v") + (match_operand:VF_128 1 "register_operand" "v") (const_int 1)))] "TARGET_AVX512ER" "vrcp28\t{%2, %1, %0|%0, %1, %2}" [(set_attr "length_immediate" "1") (set_attr "prefix" "evex") + (set_attr "type" "sse") (set_attr "mode" "")]) (define_insn "avx512er_rsqrt28" @@ -12838,19 +12841,21 @@ "TARGET_AVX512ER" "vrsqrt28\t{%1, %0|%0, %1}" [(set_attr "prefix" "evex") + (set_attr "type" "sse") (set_attr "mode" "")]) (define_insn "avx512er_vmrsqrt28" [(set (match_operand:VF_128 0 "register_operand" "=v") (vec_merge:VF_128 (unspec:VF_128 - [(match_operand:VF_128 1 "" "")] + [(match_operand:VF_128 2 "" "")] UNSPEC_RSQRT28) - (match_operand:VF_128 2 "register_operand" "v") + (match_operand:VF_128 1 "register_operand" "v") (const_int 1)))] "TARGET_AVX512ER" "vrsqrt28\t{%2, %1, %0|%0, %1, %2}" [(set_attr "length_immediate" "1") + (set_attr "type" "sse") (set_attr "prefix" "evex") (set_attr "mode" "")]) diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-2.c b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-2.c index d30f088..889f990 100644 --- a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28sd-2.c @@ -10,19 +10,20 @@ void static avx512er_test (void) { - union128d src, res; + union128d src1, src2, res; double res_ref[2]; int i; for (i = 0; i < 2; i++) { - src.a[i] = 179.345 - 6.5645 * i; - res_ref[i] = src.a[i]; + src1.a[i] = 179.345 - 6.5645 * i; + src2.a[i] = 204179.345 + 6.5645 * i; + res_ref[i] = src1.a[i]; } - res_ref[0] = 1.0 / src.a[0]; + res_ref[0] = 1.0 / src2.a[0]; - res.x = _mm_rcp28_round_sd (src.x, src.x, _MM_FROUND_NO_EXC); + res.x = _mm_rcp28_round_sd (src1.x, src2.x, _MM_FROUND_NO_EXC); if (checkVd (res.a, res_ref, 2)) abort (); diff --git a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-2.c b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-2.c index 499a977..3280879 100644 --- a/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-2.c +++ b/gcc/testsuite/gcc.target/i386/avx512er-vrcp28ss-2.c @@ -10,19 +10,20 @@ void static avx512er_test (void) { - union128 src
Re: [PATCH i386 13/8] [AVX-512] Fix argument order for perm and recp intrinsics.
On Mon, Feb 17, 2014 at 1:26 PM, Kirill Yukhin wrote: >> >> Please don't change srcp pattern, it should be defined similar to >> >> vrcpss (aka sse_vmrcpv4sf). You need to switch operand order >> >> elsewhere. >> > >> > No, you are correct. Operands should be swapped as in your patch. >> >> Eh, sorry that after some more thinking, I have to again revert this >> decision. >> >> The srcp pattern should remain as is, and you should swap operands in >> avx512fintrin.h instead: > > In the bottom there's updated patch. > > Added "sse" type. mem operand made second. > Built-ins & tests fixed. > > Testing in progress. > > Is it ok for mainline if pass? No, you got operand order wrong. To correctly calculate "memory" attribute, all "sse" type insns expect the operands in the way sse_vmrcpv4sf2 is defined. You should keep nonimmedate operand as operand_1 and switch operands in builtins and insn mnemonics to fulfill required operand order *in the pattern*. (Please also post ChangeLog for review). Uros.
Re: [Patch, Fortran, Regression] PR 55907: ICE with -fno-automatic -finit-local-zero
> This is OK for trunk, 4.8 and 4.7. Thanks, Paul. Committed to trunk as r207823. Will do the backports soon. Cheers, Janus > On 16 February 2014 23:11, Janus Weil wrote: >> Hi all, >> >> here is a small patch for a ICE-on-valid regression. Regtested on >> x86_64-unknown-linux-gnu. Ok for trunk/4.8/4.7? >> >> Cheers, >> Janus >> >> >> 2014-02-16 Janus Weil >> >> PR fortran/55907 >> * resolve.c (build_default_init_expr): Don't initialize character >> variable if -fno-automatic is given. >> >> >> 2014-02-16 Janus Weil >> >> PR fortran/55907 >> * gfortran.dg/init_flag_12.f90: New. > > > > -- > The knack of flying is learning how to throw yourself at the ground and miss. >--Hitchhikers Guide to the Galaxy
Re: Fix three issues in ipa-prop
Hi, On Mon, Feb 17, 2014 at 09:40:40AM +0100, Jan Hubicka wrote: > Hi, > Chromium LTO build ICEs on bogus get_binfo_at_offset call. This is caused by > updating pasto bug in update_jump_functions_after_inlining. > > While looking for it I noticed we have other issues here. In particular, when > combining -fno-devirtualize and -fdevirtualize units, we get all jump fuctions > as type preserved. This is because detect_type_change returns false when it > decides detection is not needed. It really should return true. Otherwise we > will > end up propagating invalid types through the -fno-devirtualize function and > produce > wrong code at LTO. > > I also added some sanity checking to jump functions while hunting the bug that > uncovered another problem in compute_complex_assign_jump_func and > compute_complex_ancestor_jump_func that are still confusing type of parameter > (that is pointer) to type of object passed by reference. > > I also made us to not save the type to ipa_set_ancestor_jf when type is not > preserved, since it will never be used for enything useful. > ipa_get_jf_ancestor_result > uses to build it the updated address, but we can safely use pointer_type_node, > because it will be converted at the substitution time anyway. > > Bootstrapped/regtested x86_64-linux, will commit it tomorrow after some > furhter testing > and unless Martin stops me ;) > > Honza > > * ipa-cp.c (ipa_get_jf_ancestor_result): Allow type to be NULL. > * ipa-prop.c (ipa_set_jf_known_type): Do not set anyting when > we do not devirtualize. > (ipa_set_ancestor_jf): Likewise; do not record type when we do not > devirtualize. > (detect_type_change): Signalize type change when giving up on > detection. > (compute_complex_assign_jump_func): Fix call of ipa_set_ancestor_jf. > (compute_complex_ancestor_jump_func): Likewise. > (update_jump_functions_after_inlining): Fix combining of PASS_THROUGH > and KNOWN_TYPE. This is fine, except that if we allow having NULL as the type of ancestor jump functions, this should be stated and explained in a comment in ipa_ancestor_jf_data in ipa-prop.h. Thanks, Martin
Re: [patch] Fix wrong code with VCE to bit-field type at -O
On Mon, Feb 17, 2014 at 11:27 AM, Eric Botcazou wrote: >> There is nothing obvious I think, i.e. that's debatable. I agree that a VCE >> from a 32-bit object to a 32-bit integer with 24-bit precision should not >> clear the upper 8 bits (so the REDUCE_BIT_FIELD part of my patch is wrong). >> But here we have a VCE from a 24-bit object to a 32-bit integer with 24-bit >> precision which reads *more bits* than the size of the source type; that I >> think is plain wrong and is fixed by the bit-field extraction in the patch. > > Revised patch along these lines attached. Although I agree that it's a bit of > a kludge, it's quite localized and plausible IMO. Woudln't it be better to do this in the series of "conversions", that is inside the preceeding if-statement? (the integral type case using convert_modes looks weird enough, so adding this kind-of "less" weird one there looks sensible) Ok with moving it there (before the else if (!MEM_P (op0))). You probably want to guard with INTEGRAL_TYPE_P (type) as well, not only GET_MODE (op0) != mode - just to prepare for weird stuff like a vector-type where TYPE_PRECISION means sth else. Thanks, Richard. > > * expr.c (expand_expr_real_1) : For a > bit-field > destination type, extract exactly the number of valid bits if the > source > type isn't integral or has a different precision. > > > -- > Eric Botcazou
[PATCH] Remove N^2 update-ssa calls in IPA SRA
This removes the update_ssa call in ipa_modify_call_arguments by keeping virtual SSA form up-to-date. It also avoids leaking the virtual SSA name defined by the replaced call (and thus keeping more than necessary memory live during early transforms). Bootstrap and regtest in progress on x86_64-unknown-linux-gnu, ok for trunk at this stage? (didn't come here with the compile-time issue but with the leaked SSA name, both would improve the general compile-time-hog/memory-usage regression) Thanks, Richard. 2014-02-17 Richard Biener * ipa-prop.c: Include stringpool.h and tree-ssanames.h. (ipa_modify_call_arguments): Emit an argument load explicitely and preserve virtual SSA form there and for the replacement call. Do not update SSA form nor free dominance info. Index: gcc/ipa-prop.c === *** gcc/ipa-prop.c (revision 207820) --- gcc/ipa-prop.c (working copy) *** along with GCC; see the file COPYING3. *** 57,62 --- 57,64 #include "tree-streamer.h" #include "params.h" #include "ipa-utils.h" + #include "stringpool.h" + #include "tree-ssanames.h" /* Intermediate information about a parameter that is only useful during the run of ipa_analyze_node and is not kept afterwards. */ *** ipa_modify_call_arguments (struct cgraph *** 3783,3800 align = (misalign & -misalign); if (align < TYPE_ALIGN (type)) type = build_aligned_type (type, align); expr = fold_build2_loc (loc, MEM_REF, type, base, off); } else { expr = fold_build2_loc (loc, MEM_REF, adj->type, base, off); expr = build_fold_addr_expr (expr); } - - expr = force_gimple_operand_gsi (&gsi, expr, - adj->by_ref - || is_gimple_reg_type (adj->type), - NULL, true, GSI_SAME_STMT); vargs.quick_push (expr); } if (adj->op != IPA_PARM_OP_COPY && MAY_HAVE_DEBUG_STMTS) --- 3785,3816 align = (misalign & -misalign); if (align < TYPE_ALIGN (type)) type = build_aligned_type (type, align); + base = force_gimple_operand_gsi (&gsi, base, + true, NULL, true, GSI_SAME_STMT); expr = fold_build2_loc (loc, MEM_REF, type, base, off); + /* If expr is not a valid gimple call argument emit +a load into a temporary. */ + if (is_gimple_reg_type (TREE_TYPE (expr))) + { + gimple tem = gimple_build_assign (NULL_TREE, expr); + if (gimple_in_ssa_p (cfun)) + { + gimple_set_vuse (tem, gimple_vuse (stmt)); + expr = make_ssa_name (TREE_TYPE (expr), tem); + } + else + expr = create_tmp_reg (TREE_TYPE (expr), NULL); + gimple_assign_set_lhs (tem, expr); + gsi_insert_before (&gsi, tem, GSI_SAME_STMT); + } } else { expr = fold_build2_loc (loc, MEM_REF, adj->type, base, off); expr = build_fold_addr_expr (expr); + expr = force_gimple_operand_gsi (&gsi, expr, + true, NULL, true, GSI_SAME_STMT); } vargs.quick_push (expr); } if (adj->op != IPA_PARM_OP_COPY && MAY_HAVE_DEBUG_STMTS) *** ipa_modify_call_arguments (struct cgraph *** 3850,3855 --- 3866,3880 gimple_set_location (new_stmt, gimple_location (stmt)); gimple_call_set_chain (new_stmt, gimple_call_chain (stmt)); gimple_call_copy_flags (new_stmt, stmt); + if (gimple_in_ssa_p (cfun)) + { + gimple_set_vuse (new_stmt, gimple_vuse (stmt)); + if (gimple_vdef (stmt)) + { + gimple_set_vdef (new_stmt, gimple_vdef (stmt)); + SSA_NAME_DEF_STMT (gimple_vdef (new_stmt)) = new_stmt; + } + } if (dump_file && (dump_flags & TDF_DETAILS)) { *** ipa_modify_call_arguments (struct cgraph *** 3867,3875 } while ((gsi_end_p (prev_gsi) && !gsi_end_p (gsi)) || (!gsi_end_p (prev_gsi) && gsi_stmt (gsi) == gsi_stmt (prev_gsi))); - - update_ssa (TODO_update_ssa); - free_dominance_info (CDI_DOMINATORS); } /* If the expression *EXPR should be replaced by a reduction of a parameter, do --- 3892,3897
[PATCH] Properly release VOP of inlined call stmt
This makes us release the virtual SSA name associated with a call that is inlined. This removes some garbage that is otherwise kept live duing early opts (and thus reduces whole-program footprint). With this patch and the separately posted ipa-prop change I can bootstrap & regtest with Index: gcc/tree-ssa.c === --- gcc/tree-ssa.c (revision 207783) +++ gcc/tree-ssa.c (working copy) @@ -741,6 +741,16 @@ verify_def (basic_block bb, basic_block goto err; } + if (bb == NULL + /* ??? Too many latent cases in the main opt pipeline. But it's + worth to fix all cases before inlining as that reduces the +amount of garbage kept live. */ + && !cfun->after_inlining) +{ + error ("removed STMT failed to release SSA name"); + goto err; +} + if (definition_block[SSA_NAME_VERSION (ssa_name)]) { error ("SSA_NAME created in two different blocks %i and %i", applied. Bootstrapped and tested (with the above applied) on x86_64-unknown-linux-gnu. Ok? Thanks, Richard. 2014-02-17 Richard Biener * tree-inline.c (expand_call_inline): Release the virtual operand defined by the call we are about to inline. Index: gcc/tree-inline.c === *** gcc/tree-inline.c (revision 207783) --- gcc/tree-inline.c (working copy) *** expand_call_inline (basic_block bb, gimp *** 4364,4369 --- 4364,4372 /* Unlink the calls virtual operands before replacing it. */ unlink_stmt_vdef (stmt); + if (gimple_vdef (stmt) + && TREE_CODE (gimple_vdef (stmt)) == SSA_NAME) + release_ssa_name (gimple_vdef (stmt)); /* If the inlined function returns a result that we care about, substitute the GIMPLE_CALL with an assignment of the return
[PATCH] Properly ICE when verify_def found an error
This adds the missing branch to err. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard. 2014-02-17 Richard Biener * tree-ssa.c (verify_ssa): If verify_def found an error, ICE. Index: gcc/tree-ssa.c === *** gcc/tree-ssa.c (revision 207819) --- gcc/tree-ssa.c (working copy) *** verify_ssa (bool check_modified_stmt) *** 988,996 if (!gimple_nop_p (stmt)) { basic_block bb = gimple_bb (stmt); ! verify_def (bb, definition_block, ! name, stmt, virtual_operand_p (name)); ! } } } --- 1006,1014 if (!gimple_nop_p (stmt)) { basic_block bb = gimple_bb (stmt); ! if (verify_def (bb, definition_block, ! name, stmt, virtual_operand_p (name))) ! goto err; } } }
Ping GCC trunk 4.9: documentation patch on plugins
Hello All, I am pinging this documentation patch http://gcc.gnu.org/ml/gcc-patches/2014-02/msg00074.html Regards. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***
Re: [PATCH][RFC][libatomic] Override -mcpu option for arm linux ifunc targets
On 13/02/14 18:23, Richard Henderson wrote: On 02/03/2014 03:50 AM, Kyrill Tkachov wrote: +# For ARM, the -march option by itself conflicts with any -mcpu option that +# we might end up passing to the build, causing an error. +# Therefore we override the -mcpu option as well. +# This shouldn't affect tuning much because the affected code is mostly +# in inline assembly anyway. @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a -DHAVE_KERNEL64 +@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@EXTRA_OVERRIDE = -mcpu=cortex-a9 Why would you want to split these across two different variables? It's easier to just add the -march and -mcpu to the same IFUNC_OPTIONS variable. Because IFUNC_OPTIONS is not used as is. It goes through some kind of machinery with the PAT_N, PAT_S, PAT_BASe, PAT_SPLIT above that is used to extract just one of the options from IFUNC_OPTIONS and adding a new entry there ends up messing up the expected order. If there's an easier way to specify the extra option I'll be happy to use it, but I couldn't find a way of doing it without rewriting a whole lot of Makefile magic. Why the choice of cortext-a9, as opposed to any of the other v7-a possibilities? If we're going to force anything, perhaps generic-armv7-a is more appropriate? Hmmm, you're right. Might as well make it explicit that we want armv7-a. How about this then? Thanks for the review, Kyrill diff --git a/libatomic/Makefile.in b/libatomic/Makefile.in index 46e60c9..b51910a 100644 --- a/libatomic/Makefile.in +++ b/libatomic/Makefile.in @@ -297,7 +297,7 @@ PAT_BASE = $(word 1,$(PAT_SPLIT)) PAT_N = $(word 2,$(PAT_SPLIT)) PAT_S = $(word 3,$(PAT_SPLIT)) IFUNC_DEF = -DIFUNC_ALT=$(PAT_S) -IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) +IFUNC_OPT = $(word $(PAT_S),$(IFUNC_OPTIONS)) $(word $(PAT_S),$(EXTRA_OVERRIDE)) M_DEPS = -MT $@ -MD -MP -MF $(DEPDIR)/$(@F).Ppo M_SIZE = -DN=$(PAT_N) M_IFUNC = $(if $(PAT_S),$(IFUNC_DEF) $(IFUNC_OPT)) @@ -313,7 +313,13 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files))) libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \ _$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \ $(am__append_3) +# For ARM, the -march option by itself conflicts with any -mcpu option that +# we might end up passing to the build, causing an error. +# Therefore we override the -mcpu option as well. +# This shouldn't affect tuning much because the affected code is mostly +# in inline assembly anyway. @ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a -DHAVE_KERNEL64 +@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@EXTRA_OVERRIDE = -mcpu=generic-armv7-a @ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586 @ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16 libatomic_convenience_la_SOURCES = $(libatomic_la_SOURCES)
Re: [PATCH] Fix PCH on AArch64 (PR pch/60010)
On Fri, Feb 14, 2014 at 02:15:52PM +, Richard Earnshaw wrote: > > > > I've put it in. > > > > R. > > > > Kyle, the PR is against 4.8. Have you tested a back-port? > Yeah, I've built it against both 4.9 and 4.8... I suspect it'll work fine for 4.7 too if anyone is still using it. regards, Kyle
[Patch, Fortran, Regression] PR 60231: ICE on undefined generic
Hi all, attached is a patch for an ICE-on-invalid problem with generics: We simply don't check if any dummy args are present. Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8? Cheers, Janus 2014-02-17 Janus Weil PR fortran/60231 * resolve.c (check_generic_tbp_ambiguity): Check for presence of dummy arguments to prevent ICE. 2014-02-17 Janus Weil PR fortran/60231 * gfortran.dg/typebound_generic_15.f90: New. Index: gcc/fortran/resolve.c === --- gcc/fortran/resolve.c (revision 207804) +++ gcc/fortran/resolve.c (working copy) @@ -11362,6 +11362,7 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, { gfc_symbol *sym1, *sym2; const char *pass1, *pass2; + gfc_formal_arglist *dummy_args; gcc_assert (t1->specific && t2->specific); gcc_assert (!t1->specific->is_generic); @@ -11384,19 +11385,33 @@ check_generic_tbp_ambiguity (gfc_tbp_generic* t1, return false; } - /* Compare the interfaces. */ + /* Determine PASS arguments. */ if (t1->specific->nopass) pass1 = NULL; else if (t1->specific->pass_arg) pass1 = t1->specific->pass_arg; else -pass1 = gfc_sym_get_dummy_args (t1->specific->u.specific->n.sym)->sym->name; +{ + dummy_args = gfc_sym_get_dummy_args (t1->specific->u.specific->n.sym); + if (dummy_args) + pass1 = dummy_args->sym->name; + else + pass1 = NULL; +} if (t2->specific->nopass) pass2 = NULL; else if (t2->specific->pass_arg) pass2 = t2->specific->pass_arg; else -pass2 = gfc_sym_get_dummy_args (t2->specific->u.specific->n.sym)->sym->name; +{ + dummy_args = gfc_sym_get_dummy_args (t2->specific->u.specific->n.sym); + if (dummy_args) + pass2 = dummy_args->sym->name; + else + pass2 = NULL; +} + + /* Compare the interfaces. */ if (gfc_compare_interfaces (sym1, sym2, sym2->name, !t1->is_operator, 0, NULL, 0, pass1, pass2)) { ! { dg-do compile } ! ! PR 60231: [4.8/4.9 Regression] ICE on undefined generic ! ! Contributed by Antony Lewis module Objects Type TObjectList contains procedure :: Add1 procedure :: Add2 generic :: Add => Add1, Add2 end Type end module ! { dg-final { cleanup-modules "Objects" } }
Re: [PATCH] Properly release VOP of inlined call stmt
On 02/17/14 06:42, Richard Biener wrote: This makes us release the virtual SSA name associated with a call that is inlined. This removes some garbage that is otherwise kept live duing early opts (and thus reduces whole-program footprint). With this patch and the separately posted ipa-prop change I can bootstrap & regtest with Index: gcc/tree-ssa.c === --- gcc/tree-ssa.c (revision 207783) +++ gcc/tree-ssa.c (working copy) @@ -741,6 +741,16 @@ verify_def (basic_block bb, basic_block goto err; } + if (bb == NULL + /* ??? Too many latent cases in the main opt pipeline. But it's + worth to fix all cases before inlining as that reduces the +amount of garbage kept live. */ + && !cfun->after_inlining) +{ + error ("removed STMT failed to release SSA name"); + goto err; +} + if (definition_block[SSA_NAME_VERSION (ssa_name)]) { error ("SSA_NAME created in two different blocks %i and %i", applied. Bootstrapped and tested (with the above applied) on x86_64-unknown-linux-gnu. Ok? Thanks, Richard. 2014-02-17 Richard Biener * tree-inline.c (expand_call_inline): Release the virtual operand defined by the call we are about to inline. OK. ISTM that we ought to define stage4 as explicitly including this kind of stuff in addition to regression fixing. Not sure exactly what wording we'd want to use though. If you wanted to really go nuts, install a mark hook on for the RTL GGC routines that flags when a deleted insn is still reachable ;-) It's obviously not OK for the tree, but good for finding leaking deleted insns. Jeff
Re: [PATCH] Properly release VOP of inlined call stmt
On Mon, 17 Feb 2014, Jeff Law wrote: > On 02/17/14 06:42, Richard Biener wrote: > > > > This makes us release the virtual SSA name associated with a call that > > is inlined. This removes some garbage that is otherwise kept live > > duing early opts (and thus reduces whole-program footprint). > > > > With this patch and the separately posted ipa-prop change I can > > bootstrap & regtest with > > > > Index: gcc/tree-ssa.c > > === > > --- gcc/tree-ssa.c (revision 207783) > > +++ gcc/tree-ssa.c (working copy) > > @@ -741,6 +741,16 @@ verify_def (basic_block bb, basic_block > > goto err; > > } > > > > + if (bb == NULL > > + /* ??? Too many latent cases in the main opt pipeline. But it's > > + worth to fix all cases before inlining as that reduces the > > +amount of garbage kept live. */ > > + && !cfun->after_inlining) > > +{ > > + error ("removed STMT failed to release SSA name"); > > + goto err; > > +} > > + > > if (definition_block[SSA_NAME_VERSION (ssa_name)]) > > { > > error ("SSA_NAME created in two different blocks %i and %i", > > > > applied. > > > > Bootstrapped and tested (with the above applied) on > > x86_64-unknown-linux-gnu. Ok? > > > > Thanks, > > Richard. > > > > 2014-02-17 Richard Biener > > > > * tree-inline.c (expand_call_inline): Release the virtual > > operand defined by the call we are about to inline. > OK. > > ISTM that we ought to define stage4 as explicitly including this kind of stuff > in addition to regression fixing. Not sure exactly what wording we'd want to > use though. > > If you wanted to really go nuts, install a mark hook on for the RTL GGC > routines that flags when a deleted insn is still reachable ;-) It's obviously > not OK for the tree, but good for finding leaking deleted insns. Yeah, though anything allocated post-IPA transform apply only exists for a single function at a time while pre-IPA allocated stuff accumulates for the whole compilation unit. So it's doubly worth spending on fixing the pre-IPA stuff (even with unreleased SSA names the post-IPA world is a big mess ;)) Richard.
[PATCH] Properly release pattern stmts
This makes sure pattern stmts do not appear to be in the IL, first by setting their BB to NULL again (the vectorizer sets this for convenience I guess) and second by releasing SSA names we temporarily allocated. Esp. the non-NULL BB may confuse passes walking over non-released SSA names. Bootstrapped and tested on x86_64-unknown-linux-gnu, ok? Thanks, Richard. 2014-02-17 Richard Biener * tree-vect-stmts.c (free_stmt_vec_info): Clear BB and release SSA defs of pattern stmts. Index: gcc/tree-vect-stmts.c === --- gcc/tree-vect-stmts.c (revision 207757) +++ gcc/tree-vect-stmts.c (working copy) @@ -7389,13 +7389,25 @@ free_stmt_vec_info (gimple stmt) if (patt_info) { gimple_seq seq = STMT_VINFO_PATTERN_DEF_SEQ (patt_info); + gimple patt_stmt = STMT_VINFO_STMT (patt_info); + gimple_set_bb (patt_stmt, NULL); + tree lhs = gimple_get_lhs (patt_stmt); + if (TREE_CODE (lhs) == SSA_NAME) + release_ssa_name (lhs); if (seq) { gimple_stmt_iterator si; for (si = gsi_start (seq); !gsi_end_p (si); gsi_next (&si)) - free_stmt_vec_info (gsi_stmt (si)); + { + gimple seq_stmt = gsi_stmt (si); + gimple_set_bb (seq_stmt, NULL); + lhs = gimple_get_lhs (patt_stmt); + if (TREE_CODE (lhs) == SSA_NAME) + release_ssa_name (lhs); + free_stmt_vec_info (seq_stmt); + } } - free_stmt_vec_info (STMT_VINFO_RELATED_STMT (stmt_info)); + free_stmt_vec_info (patt_stmt); } }
Re: [PATCH] Properly release pattern stmts
On Mon, Feb 17, 2014 at 04:25:25PM +0100, Richard Biener wrote: > > This makes sure pattern stmts do not appear to be in the IL, > first by setting their BB to NULL again (the vectorizer sets this > for convenience I guess) and second by releasing SSA names we > temporarily allocated. > > Esp. the non-NULL BB may confuse passes walking over > non-released SSA names. > > Bootstrapped and tested on x86_64-unknown-linux-gnu, ok? > > Thanks, > Richard. > > 2014-02-17 Richard Biener > > * tree-vect-stmts.c (free_stmt_vec_info): Clear BB and > release SSA defs of pattern stmts. Ok. Jakub
[PATCH][RFC] Cache ao_ref inside MEM_ATTRs
The following patch caches the ao_ref (the meta-data used by the "gimple" alias oracle) in MEM_ATTRs, inheriting the existing MEM_EXPR and MEM_ALIAS_SET fields. This reduces the load on the get_ref_base_and_extent and the get_alias_set calls that are eventually done when rtx_refs_may_alias_p dispatches to the "gimple" alias oracle from the RTL oracle. Especially for cases where we do nearly O (n^2) queries this reduces the work we spend significantly. RFC because this enlarges the mem_attrs struct from 40 to 80 bytes (on x86_64). Bootstrapped and tested on x86_64-unknown-linux-gnu. Comments? Thanks, Richard. Enlarges struct mem_attrs from 40 to 80 bytes on x86_64 2014-02-13 Richard Biener * tree-ssa-alias.h (struct ao_ref): Mark GTY(()). * rtl.h: Include tree-ssa-alias.h. (struct mem_attrs): Add ao_ref mem member and make it provide expr and alias. (MEM_ALIAS_SET): Adjust. (MEM_EXPR): Likewise. * alias.c (ao_ref_from_mem): Adjust and cache the result in mem_attrs.mem. * emit-rtl.c (mem_attrs_htab_hash): Adjust. (mem_attrs_eq_p): Likewise. (set_mem_attributes_minus_bitpos): Likewise. (set_mem_alias_set): Likewise. (set_mem_expr): Likewise. (change_address): Likewise. (adjust_address_1): Likewise. (widen_memory_access): Likewise. (get_spill_slot_decl): Likewise. (set_mem_attrs_for_spill): Likewise. Index: gcc/tree-ssa-alias.h === *** gcc/tree-ssa-alias.h.orig 2014-02-11 14:36:04.592802934 +0100 --- gcc/tree-ssa-alias.h2014-02-13 13:56:01.591071306 +0100 *** struct GTY(()) pt_solution *** 64,70 /* Simplified and cached information about a memory reference tree. Used by the alias-oracle internally and externally in alternate interfaces. */ ! struct ao_ref { /* The original full memory reference tree or NULL_TREE if that is not available. */ --- 64,70 /* Simplified and cached information about a memory reference tree. Used by the alias-oracle internally and externally in alternate interfaces. */ ! struct GTY(()) ao_ref { /* The original full memory reference tree or NULL_TREE if that is not available. */ Index: gcc/rtl.h === *** gcc/rtl.h.orig 2014-02-11 14:36:04.592802934 +0100 --- gcc/rtl.h 2014-02-13 13:56:01.604071305 +0100 *** along with GCC; see the file COPYING3. *** 29,34 --- 29,35 #include "alias.h" #include "hashtab.h" #include "flags.h" + #include "tree-ssa-alias.h" /* Value used by some passes to "recognize" noop moves as valid instructions. */ *** struct GTY(()) mem_attrs *** 140,146 /* The expression that the MEM accesses, or null if not known. This expression might be larger than the memory reference itself. (In other words, the MEM might access only part of the object.) */ ! tree expr; /* The offset of the memory reference from the start of EXPR. Only valid if OFFSET_KNOWN_P. */ --- 141,147 /* The expression that the MEM accesses, or null if not known. This expression might be larger than the memory reference itself. (In other words, the MEM might access only part of the object.) */ ! ao_ref mem; /* The offset of the memory reference from the start of EXPR. Only valid if OFFSET_KNOWN_P. */ *** struct GTY(()) mem_attrs *** 150,158 SIZE_KNOWN_P. */ HOST_WIDE_INT size; - /* The alias set of the memory reference. */ - alias_set_type alias; - /* The alignment of the reference in bits. Always a multiple of BITS_PER_UNIT. Note that EXPR may have a stricter alignment than the memory reference itself. */ --- 151,156 *** do { \ *** 1474,1484 language-dependent manner in the front-end, and should not be altered in the back-end. These set numbers are tested with alias_sets_conflict_p. */ ! #define MEM_ALIAS_SET(RTX) (get_mem_attrs (RTX)->alias) /* For a MEM rtx, the decl it is known to refer to, if it is known to refer to part of a DECL. It may also be a COMPONENT_REF. */ ! #define MEM_EXPR(RTX) (get_mem_attrs (RTX)->expr) /* For a MEM rtx, true if its MEM_OFFSET is known. */ #define MEM_OFFSET_KNOWN_P(RTX) (get_mem_attrs (RTX)->offset_known_p) --- 1472,1482 language-dependent manner in the front-end, and should not be altered in the back-end. These set numbers are tested with alias_sets_conflict_p. */ ! #define MEM_ALIAS_SET(RTX) (get_mem_attrs (RTX)->mem.ref_alias_set) /* For a MEM rtx, the decl it is known to refer to, if it is known to refer to part of a DECL. It may also be a COMPONENT_R
[gomp4] libgomp: Don't update copy_from for the existing mappings.
Hi Thomas, Here is the fix for the issue discussed in http://gcc.gnu.org/ml/gcc/2014-02/msg00257.html OK to commit to gomp-4_0-branch? --- libgomp/ChangeLog.gomp |5 + libgomp/target.c |5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libgomp/ChangeLog.gomp b/libgomp/ChangeLog.gomp index 8f3da2b..12c0c53 100644 --- a/libgomp/ChangeLog.gomp +++ b/libgomp/ChangeLog.gomp @@ -1,3 +1,8 @@ +2014-02-17 Ilya Verbin + + * target.c (gomp_map_vars_existing): Don't update copy_from for the + existing mappings. + 2014-01-28 Thomas Schwinge * testsuite/libgomp.oacc-c/parallel-1.c: Extend. diff --git a/libgomp/target.c b/libgomp/target.c index 55d3891..15c20d8 100644 --- a/libgomp/target.c +++ b/libgomp/target.c @@ -171,11 +171,6 @@ gomp_map_vars_existing (splay_tree_key oldn, splay_tree_key newn, "[%p..%p) is already mapped", (void *) newn->host_start, (void *) newn->host_end, (void *) oldn->host_start, (void *) oldn->host_end); - if (((kind & 7) == 2 || (kind & 7) == 3) - && !oldn->copy_from - && oldn->host_start == newn->host_start - && oldn->host_end == newn->host_end) -oldn->copy_from = true; oldn->refcount++; } -- 1.7.1 -- Ilya
RFA: Fix some gcc tests for 16-bit targets
Hi Guys, There are several tests in the gcc testsuite which implicitly assume a 32-bit (or larger) target. The patch below provides fixes for these tests in a variety of different ways. Where possible I have tried to recode the test so that it will compile on a 16-bit target, but in a couple of cases the test itself is too big, and so I have added a requirement on a 32-bit+ target. Tested with no regressions on an i686-pc-linux-gnu and an x86_64-pc-linux-gnu toolchain, and with reduction in the number of unexpected failures for rl78-elf, rx-elf and msp430-elf toolchains. OK to apply ? Cheers Nick gcc/testsuite/ChangeLog 2014-02-17 Nick Clifton * gcc.dg/c-torture/execute/pr43220.c: Use a long integer to count the iterations. * gcc.c-torture/execute/pr58570.c: Use a long integer to hold a 29-bit bitfield. * gcc.c-torture/unsorted/DFcmp.c: Use smaller arrays on 16-bit targets. * gcc.c-torture/unsorted/SFset.c: Likewise. * gcc.dg/graphite/pr46966.c: Require a 32-bit plus target - it is too big for smaller targets. * gcc.dg/pr23623.c: Use a long integer to hold 31-bit bitfields. * gcc.dg/pr48784-1.c: Use a long integer to hold a 28-bit bitfield. * gcc.dg/pr48784-2.c: Likewise. * gcc.dg/pr56997-2.c: Use a long integer as the test_type on 16-bit targets. * gcc.dg/pr59471.c: Use a long integer as the 32-bit vector type on 16-bit targets. * gcc.dg/sms-6.c: Use a long integer as the array_type on 16-bit targets. * gcc.dg/torture/vec-cvt-1.c: Require a 32-bit plus target - it is too big for smaller targets. Index: gcc/testsuite/gcc.c-torture/execute/pr43220.c === --- gcc/testsuite/gcc.c-torture/execute/pr43220.c (revision 207817) +++ gcc/testsuite/gcc.c-torture/execute/pr43220.c (working copy) @@ -3,7 +3,7 @@ int main (void) { - int n = 0; + long int n = 0; lab:; { int x[n % 1000 + 1]; Index: gcc/testsuite/gcc.c-torture/execute/pr58570.c === --- gcc/testsuite/gcc.c-torture/execute/pr58570.c (revision 207817) +++ gcc/testsuite/gcc.c-torture/execute/pr58570.c (working copy) @@ -2,7 +2,7 @@ struct S { int f0:15; - int f1:29; + long int f1:29; }; int e = 1, i; Index: gcc/testsuite/gcc.c-torture/unsorted/DFcmp.c === --- gcc/testsuite/gcc.c-torture/unsorted/DFcmp.c(revision 207817) +++ gcc/testsuite/gcc.c-torture/unsorted/DFcmp.c(working copy) @@ -22,6 +22,17 @@ #define adrx1 (E1[x1]) #define regx1 (p1[x1]) +#if __SIZEOF_INT__ <= 2 +#undef E0 +#define E0 ((type *)1) +#undef adrreg0 +#define adrreg0 (p0[1]) +#undef E1 +#define E1 ((type *)( & ~(__alignof__ (type) - 1))) +#undef adrreg1 +#define adrreg1 (p1[/4]) +#endif + reg0reg1 (r0, r1, x0, x1, p0, p1) type r0, r1; type *p0, *p1; {if (reg0 <= reg1) return 1; else return 0;} Index: gcc/testsuite/gcc.c-torture/unsorted/SFset.c === --- gcc/testsuite/gcc.c-torture/unsorted/SFset.c(revision 207817) +++ gcc/testsuite/gcc.c-torture/unsorted/SFset.c(working copy) @@ -18,6 +18,17 @@ #define adrx1 (E1[x1]) #define regx1 (p1[x1]) +#if __SIZEOF_INT__ <= 2 +#undef E0 +#define E0 ((type *)1) +#undef adrreg0 +#define adrreg0 (p0[1]) +#undef E1 +#define E1 ((type *)( & ~(__alignof__ (type) - 1))) +#undef adrreg1 +#define adrreg1 (p1[/4]) +#endif + int glob0, glob1; #define type float Index: gcc/testsuite/gcc.dg/graphite/pr46966.c === --- gcc/testsuite/gcc.dg/graphite/pr46966.c (revision 207817) +++ gcc/testsuite/gcc.dg/graphite/pr46966.c (working copy) @@ -1,5 +1,7 @@ /* PR tree-optimization/46966 */ /* { dg-do compile } */ +/* This test is too big for small targets. */ +/* { dg-require-effective-target size32plus } */ /* { dg-options "-O -floop-interchange -ffast-math -fno-tree-copy-prop -fno-tree-loop-im" } */ int a[1000][1000]; Index: gcc/testsuite/gcc.dg/pr23623.c === --- gcc/testsuite/gcc.dg/pr23623.c (revision 207817) +++ gcc/testsuite/gcc.dg/pr23623.c (working copy) @@ -8,19 +8,19 @@ extern struct { unsigned int b : 1; - unsigned int : 31; + unsigned long int : 31; } bf1; extern volatile struct { unsigned int b : 1; - unsigned int : 31; + unsigned long int : 31; } bf2; extern struct { volatile unsigned int b : 1; - volatile unsigned int : 31; + volatile unsigned long int : 31; } bf3; void writeb(void) @@ -45,4 +45,3 @@ variable, we need to give a count of 12 instead of 6 here. */
[PATCH] Properly check for _Cilk_spawn in return stmt (PR c/60197)
I don't know Cilk stuff at all, but it seems that _Cilk_spawn is forbidden in a return statement. But then only checking TREE_CODE (retval) == CILK_SPAWN_STMT isn't sufficient, because CILK_SPAWN_STMT can be wrapped e.g. in MINUS_EXPR, C_MAYBE_CONST_EXPR, EQ_EXPR, and a bunch of others. I used walk_tree for checking whether a return statement contains any CILK_SPAWN_STMT. Regtested/bootstrapped on x86_64-linux, ok for 5.0? 2014-02-17 Marek Polacek PR c/60197 c-family/ * array-notation-common.c (contains_cilk_spawn_stmt): New function. (contains_cilk_spawn_stmt_walker): Likewise. * c-common.h (contains_cilk_spawn_stmt): Add declaration. c/ * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead of checking tree code. cp/ * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead of checking tree code. testsuite/ * c-c++-common/cilk-plus/CK/pr60197.c: New test. diff --git gcc/c-family/array-notation-common.c gcc/c-family/array-notation-common.c index c010039..5d1e2c8 100644 --- gcc/c-family/array-notation-common.c +++ gcc/c-family/array-notation-common.c @@ -657,3 +657,25 @@ fix_sec_implicit_args (location_t loc, vec *list, vec_safe_push (array_operand, (*list)[ii]); return array_operand; } + +/* Helper for contains_cilk_spawn_stmt, callback for walk_tree. Return + non-null tree if TP contains CILK_SPAWN_STMT. */ + +static tree +contains_cilk_spawn_stmt_walker (tree *tp, int *, void *) +{ + if (TREE_CODE (*tp) == CILK_SPAWN_STMT) +return *tp; + else +return NULL_TREE; +} + +/* Returns true if EXPR or any of its subtrees contain CILK_SPAWN_STMT + node. */ + +bool +contains_cilk_spawn_stmt (tree expr) +{ + return walk_tree (&expr, contains_cilk_spawn_stmt_walker, NULL, NULL) +!= NULL_TREE; +} diff --git gcc/c-family/c-common.h gcc/c-family/c-common.h index f074ab1..6f2c6b7 100644 --- gcc/c-family/c-common.h +++ gcc/c-family/c-common.h @@ -1375,6 +1375,7 @@ extern void cilkplus_extract_an_triplets (vec *, size_t, size_t, vec > *); extern vec *fix_sec_implicit_args (location_t, vec *, vec, size_t, tree); +extern bool contains_cilk_spawn_stmt (tree); /* In cilk.c. */ extern tree insert_cilk_frame (tree); diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c index da6a6fc..23cdb0e 100644 --- gcc/c/c-typeck.c +++ gcc/c/c-typeck.c @@ -9134,7 +9134,7 @@ c_finish_return (location_t loc, tree retval, tree origtype) return error_mark_node; } } - if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT) + if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval)) { error_at (loc, "use of %<_Cilk_spawn%> in a return statement is not " "allowed"); diff --git gcc/cp/typeck.c gcc/cp/typeck.c index 5fc0e6b..566411f 100644 --- gcc/cp/typeck.c +++ gcc/cp/typeck.c @@ -8328,7 +8328,7 @@ check_return_expr (tree retval, bool *no_warning) *no_warning = false; - if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT) + if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval)) { error_at (EXPR_LOCATION (retval), "use of %<_Cilk_spawn%> in a return " "statement is not allowed"); diff --git gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c index e69de29..2b47d1e 100644 --- gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c +++ gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c @@ -0,0 +1,66 @@ +/* PR c/60197 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +extern int foo (void); +extern int bar (int); + +int +fn1 (void) +{ + return (_Cilk_spawn foo ()) * 2; /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn2 (void) +{ + return (_Cilk_spawn foo ()) > 2; /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn3 (int i, int j, int k) +{ + return ((_Cilk_spawn foo () + i) - j) * k) / j) | i) ^ k) ; /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn4 (int i, int j, int k) +{ + return (i - _Cilk_spawn foo ()) * k) / j) | i) ^ k); /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn5 (void) +{ + return _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn6 (void) +{ + return _Cilk_spawn foo () + _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn7 (void) +{ + return 5 % _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn8 (void) +{ + return !_Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn9 (void) +{ + return foo () && _Cilk_spawn foo (); /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn10 (void) +{ + return bar (_Cilk_spawn foo ()); /* { dg-error "in a return statement is not allo
RE: [PATCH] Properly check for _Cilk_spawn in return stmt (PR c/60197)
Hi Marek, Thanks for working on this. Please see my comments below. > -Original Message- > From: Marek Polacek [mailto:pola...@redhat.com] > Sent: Monday, February 17, 2014 12:43 PM > To: GCC Patches > Cc: Iyer, Balaji V > Subject: [PATCH] Properly check for _Cilk_spawn in return stmt (PR c/60197) > > I don't know Cilk stuff at all, but it seems that _Cilk_spawn is forbidden in > a > return statement. But then only checking TREE_CODE (retval) == > CILK_SPAWN_STMT isn't sufficient, because CILK_SPAWN_STMT can be > wrapped e.g. in MINUS_EXPR, C_MAYBE_CONST_EXPR, EQ_EXPR, and a > bunch of others. I used walk_tree for checking whether a return statement > contains any CILK_SPAWN_STMT. > > Regtested/bootstrapped on x86_64-linux, ok for 5.0? > 5.0? you mean 4.9 right?... since this is a minor bug-fix. > 2014-02-17 Marek Polacek > > PR c/60197 > c-family/ > * array-notation-common.c (contains_cilk_spawn_stmt): New > function. > (contains_cilk_spawn_stmt_walker): Likewise. > * c-common.h (contains_cilk_spawn_stmt): Add declaration. > c/ > * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead > of checking tree code. > cp/ > * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt > instead > of checking tree code. > testsuite/ > * c-c++-common/cilk-plus/CK/pr60197.c: New test. > > diff --git gcc/c-family/array-notation-common.c gcc/c-family/array-notation- > common.c > index c010039..5d1e2c8 100644 > --- gcc/c-family/array-notation-common.c > +++ gcc/c-family/array-notation-common.c > @@ -657,3 +657,25 @@ fix_sec_implicit_args (location_t loc, vec va_gc> *list, >vec_safe_push (array_operand, (*list)[ii]); >return array_operand; > } > + > +/* Helper for contains_cilk_spawn_stmt, callback for walk_tree. Return > + non-null tree if TP contains CILK_SPAWN_STMT. */ > + > +static tree > +contains_cilk_spawn_stmt_walker (tree *tp, int *, void *) { > + if (TREE_CODE (*tp) == CILK_SPAWN_STMT) > +return *tp; > + else > +return NULL_TREE; > +} > + > +/* Returns true if EXPR or any of its subtrees contain CILK_SPAWN_STMT > + node. */ > + > +bool > +contains_cilk_spawn_stmt (tree expr) > +{ > + return walk_tree (&expr, contains_cilk_spawn_stmt_walker, NULL, NULL) > + != NULL_TREE; > +} I would move these two functions to cilk.c file instead of array-notations-common.c since cilk.c contains all Cilk keyword handling routines. > diff --git gcc/c-family/c-common.h gcc/c-family/c-common.h index > f074ab1..6f2c6b7 100644 > --- gcc/c-family/c-common.h > +++ gcc/c-family/c-common.h > @@ -1375,6 +1375,7 @@ extern void cilkplus_extract_an_triplets (vec va_gc> *, size_t, size_t, > vec > *); > extern vec *fix_sec_implicit_args >(location_t, vec *, vec, size_t, tree); > +extern bool contains_cilk_spawn_stmt (tree); > ...and put the prototype under /* In Cilk.c. */ part). > /* In cilk.c. */ > extern tree insert_cilk_frame (tree); > diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c index da6a6fc..23cdb0e 100644 > --- gcc/c/c-typeck.c > +++ gcc/c/c-typeck.c > @@ -9134,7 +9134,7 @@ c_finish_return (location_t loc, tree retval, tree > origtype) > return error_mark_node; > } > } > - if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT) > + if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval)) > { >error_at (loc, "use of %<_Cilk_spawn%> in a return statement is not " > "allowed"); > diff --git gcc/cp/typeck.c gcc/cp/typeck.c index 5fc0e6b..566411f 100644 > --- gcc/cp/typeck.c > +++ gcc/cp/typeck.c > @@ -8328,7 +8328,7 @@ check_return_expr (tree retval, bool *no_warning) > >*no_warning = false; > > - if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT) > + if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval)) > { >error_at (EXPR_LOCATION (retval), "use of %<_Cilk_spawn%> in a return > " > "statement is not allowed"); > diff --git gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c gcc/testsuite/c- > c++-common/cilk-plus/CK/pr60197.c > index e69de29..2b47d1e 100644 > --- gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c > +++ gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c > @@ -0,0 +1,66 @@ > +/* PR c/60197 */ > +/* { dg-do compile } */ > +/* { dg-options "-fcilkplus" } */ > + > +extern int foo (void); > +extern int bar (int); > + > +int > +fn1 (void) > +{ > + return (_Cilk_spawn foo ()) * 2; /* { dg-error "in a return statement > +is not allowed" } */ } > + > +int > +fn2 (void) > +{ > + return (_Cilk_spawn foo ()) > 2; /* { dg-error "in a return statement > +is not allowed" } */ } > + > +int > +fn3 (int i, int j, int k) > +{ > + return ((_Cilk_spawn foo () + i) - j) * k) / j) | i) ^ k) ; /* { > +dg-error "in a return statement is not allowed" } */ } > + > +int > +fn4 (int i, int j, int k) > +{ > + return (((
PATCH: MAINTAINERS
I have not actively created or reviewed libstdc++ patches for a while. As committed: 2014-02-17 Loren J. Rittle * MAINTAINERS (Various Maintainers: c++ runtime libs): Remove myself. Index: MAINTAINERS === --- MAINTAINERS(revision 207827) +++ MAINTAINERS(working copy) @@ -198,7 +198,6 @@ c++ runtime libsPaolo Carlinipaolo.carl...@oracle.com c++ runtime libsUlrich Drepperdrep...@gmail.com c++ runtime libsBenjamin De Kosnikb...@gnu.org -c++ runtime libsLoren J. Rittleljrit...@acm.org c++ runtime libsJonathan Wakelyr...@gcc.gnu.org *synthetic multiplyTorbjorn Granlundt...@swox.com *c-tortureTorbjorn Granlundt...@swox.com
[PATCH] Fix -march=native (PR driver/60233)
Hi! As discussed in the PR, because -mf16c implies -mavx, if the CPU has F16C (and AVX) support, but OS doesn't save YMM state, we shouldn't be passing -mf16c. Also, as noticed by Uros, the clearing of has_fma4 and has_xop if OS doesn't save YMM state was done before it was set. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2014-02-17 Jakub Jelinek Uros Bizjak PR driver/60233 * config/i386/driver-i386.c (host_detect_local_cpu): If YMM state is not saved by the OS, also clear has_f16c. Move CPUID 0x8001 handling before YMM state saving checking. --- gcc/config/i386/driver-i386.c.jj2014-01-03 11:41:06.0 +0100 +++ gcc/config/i386/driver-i386.c 2014-02-17 10:46:30.572170077 +0100 @@ -495,6 +495,28 @@ const char *host_detect_local_cpu (int a has_xsaveopt = eax & bit_XSAVEOPT; } + /* Check cpuid level of extended features. */ + __cpuid (0x8000, ext_level, ebx, ecx, edx); + + if (ext_level > 0x8000) +{ + __cpuid (0x8001, eax, ebx, ecx, edx); + + has_lahf_lm = ecx & bit_LAHF_LM; + has_sse4a = ecx & bit_SSE4a; + has_abm = ecx & bit_ABM; + has_lwp = ecx & bit_LWP; + has_fma4 = ecx & bit_FMA4; + has_xop = ecx & bit_XOP; + has_tbm = ecx & bit_TBM; + has_lzcnt = ecx & bit_LZCNT; + has_prfchw = ecx & bit_PRFCHW; + + has_longmode = edx & bit_LM; + has_3dnowp = edx & bit_3DNOWP; + has_3dnow = edx & bit_3DNOW; +} + /* Get XCR_XFEATURE_ENABLED_MASK register with xgetbv. */ #define XCR_XFEATURE_ENABLED_MASK 0x0 #define XSTATE_FP 0x1 @@ -513,33 +535,12 @@ const char *host_detect_local_cpu (int a has_avx2 = 0; has_fma = 0; has_fma4 = 0; + has_f16c = 0; has_xop = 0; has_xsave = 0; has_xsaveopt = 0; } - /* Check cpuid level of extended features. */ - __cpuid (0x8000, ext_level, ebx, ecx, edx); - - if (ext_level > 0x8000) -{ - __cpuid (0x8001, eax, ebx, ecx, edx); - - has_lahf_lm = ecx & bit_LAHF_LM; - has_sse4a = ecx & bit_SSE4a; - has_abm = ecx & bit_ABM; - has_lwp = ecx & bit_LWP; - has_fma4 = ecx & bit_FMA4; - has_xop = ecx & bit_XOP; - has_tbm = ecx & bit_TBM; - has_lzcnt = ecx & bit_LZCNT; - has_prfchw = ecx & bit_PRFCHW; - - has_longmode = edx & bit_LM; - has_3dnowp = edx & bit_3DNOWP; - has_3dnow = edx & bit_3DNOW; -} - if (!arch) { if (vendor == signature_AMD_ebx Jakub
[PATCH] Fix epilogue bb expansion (PR middle-end/60175)
Hi! On ARM we ICE on nosanitize-and-inline.c testcase during loop unrolling, but the bug seems to be on all targets that during expansion the frequency of the pre-exit basic block is out of bounds. The problem is that we have a function ending with return 0;, so that basic block is expanded as unconditional jump to the return_label. When construct_exit_block is called, expand_function_end emits some clobbers for the case when a function has fallthru into the exit block, and only after that return_label to which the unconditional jump jumps. frequency of the new exit block (bb4) is set from the frequency of the EXIT block (bb1), but then when find_many_sub_basic_blocks is called, it of course needs to create a new basic block at return_label, because it is a label that should start a basic block. But that leaves us with a 1 frequency basic block falling through to the one with return_label, and unconditional jump from a bb with frequency 1 to that basic block too, so frequency 2 instead of maximum 1. Without -fsanitize=address this isn't normally a problem because cfg cleanup merges the new basic block with the preceeding one and thus the frequency is ignored. But -fsanitize=address needs to do conditional branch in the exit block and that leads to leaking the out of bound frequencies like 19992 into the IL. Fixed by not adding clobbers at all after BARRIER (at that point we know there will not be a fallthru, so why should we emit something that is going to be removed immediately anyway), and by appending anything that is emitted before the return_label to the prev_bb basic block. find_many_sub_basic_blocks should take care of splitting it if there is no fallthru without control insn. Initially I had in that code (if there is anything other than return_label) at head an assert that find_fallthru_edge (prev_bb->succs) is non-NULL, but turns out that in some cases e.g. prev_bb ends with a __builtin_trap () and expand_function_end emitted a pending stack adjustment into the sequence (which of course should be thrown away afterwards), so I've removed the assert; find_many_sub_basic_blocks/cfg cleanup takes care of throwing away the dead insns in that case. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2014-02-17 Jakub Jelinek PR middle-end/60175 * function.c (expand_function_end): Don't emit clobber_return_register sequence if clobber_after is a BARRIER. * cfgexpand.c (construct_exit_block): Append instructions before return_label to prev_bb. --- gcc/function.c.jj 2014-02-17 10:05:24.720195450 +0100 +++ gcc/function.c 2014-02-17 11:20:35.149587876 +0100 @@ -5156,17 +5156,20 @@ expand_function_end (void) crtl->return_rtx = outgoing; } - /* Emit the actual code to clobber return register. */ - { -rtx seq; + /* Emit the actual code to clobber return register. Don't emit + it if clobber_after is a barrier, then the previous basic block + certainly doesn't fall thru into the exit block. */ + if (!BARRIER_P (clobber_after)) +{ + rtx seq; -start_sequence (); -clobber_return_register (); -seq = get_insns (); -end_sequence (); + start_sequence (); + clobber_return_register (); + seq = get_insns (); + end_sequence (); -emit_insn_after (seq, clobber_after); - } + emit_insn_after (seq, clobber_after); +} /* Output the label for the naked return from the function. */ if (naked_return_label) --- gcc/cfgexpand.c.jj 2014-02-11 09:58:19.0 +0100 +++ gcc/cfgexpand.c 2014-02-17 12:14:44.441191129 +0100 @@ -5273,7 +5273,8 @@ construct_exit_block (void) edge e, e2; unsigned ix; edge_iterator ei; - rtx orig_end = BB_END (EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb); + basic_block prev_bb = EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb; + rtx orig_end = BB_END (prev_bb); rtl_profile_for_bb (EXIT_BLOCK_PTR_FOR_FN (cfun)); @@ -5288,13 +5289,25 @@ construct_exit_block (void) end = get_last_insn (); if (head == end) return; - /* While emitting the function end we could move end of the last basic block. - */ - BB_END (EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb) = orig_end; + /* While emitting the function end we could move end of the last basic + block. */ + BB_END (prev_bb) = orig_end; while (NEXT_INSN (head) && NOTE_P (NEXT_INSN (head))) head = NEXT_INSN (head); - exit_block = create_basic_block (NEXT_INSN (head), end, - EXIT_BLOCK_PTR_FOR_FN (cfun)->prev_bb); + /* But make sure exit_block starts with RETURN_LABEL, otherwise the + bb frequency counting will be confused. Any instructions before that + label are emitted for the case where PREV_BB falls through into the + exit block, so append those instructions to prev_bb in that case. */ + if (NEXT_INSN (head) != return_label) +{ + while (NEXT_INSN (head) != return_label) + { +
Re: RFA: Fix some gcc tests for 16-bit targets
> struct S > { >int f0:15; > - int f1:29; > + long int f1:29; > }; IIRC if you change one field here, you need to change both as some targets won't pack fields together if the types don't match. Likewise for other struct-field cases.
Re: RFA: Fix some gcc tests for 16-bit targets
On February 17, 2014 6:03:56 PM GMT+01:00, Nick Clifton wrote: >Hi Guys, > > There are several tests in the gcc testsuite which implicitly assume a > 32-bit (or larger) target. The patch below provides fixes for these > tests in a variety of different ways. Where possible I have tried to > recode the test so that it will compile on a 16-bit target, but in a > couple of cases the test itself is too big, and so I have added a > requirement on a 32-bit+ target. > > Tested with no regressions on an i686-pc-linux-gnu and an > x86_64-pc-linux-gnu toolchain, and with reduction in the number of > unexpected failures for rl78-elf, rx-elf and msp430-elf toolchains. > > OK to apply ? Instead of modifying testcases I'd be less nervous if you'd make them require 32bit. Otherwise you should reproduce the original issues with the modified testcases. Thanks, Richard. >Cheers > Nick > >gcc/testsuite/ChangeLog >2014-02-17 Nick Clifton > > * gcc.dg/c-torture/execute/pr43220.c: Use a long integer to > count the iterations. >* gcc.c-torture/execute/pr58570.c: Use a long integer to hold a > 29-bit bitfield. >* gcc.c-torture/unsorted/DFcmp.c: Use smaller arrays on 16-bit > targets. >* gcc.c-torture/unsorted/SFset.c: Likewise. >* gcc.dg/graphite/pr46966.c: Require a 32-bit plus target - it > is too big for smaller targets. >* gcc.dg/pr23623.c: Use a long integer to hold 31-bit > bitfields. >* gcc.dg/pr48784-1.c: Use a long integer to hold a 28-bit > bitfield. >* gcc.dg/pr48784-2.c: Likewise. >* gcc.dg/pr56997-2.c: Use a long integer as the test_type on > 16-bit targets. > * gcc.dg/pr59471.c: Use a long integer as the 32-bit vector type > on 16-bit targets. >* gcc.dg/sms-6.c: Use a long integer as the array_type on > 16-bit targets. >* gcc.dg/torture/vec-cvt-1.c: Require a 32-bit plus target - it > is too big for smaller targets. > >Index: gcc/testsuite/gcc.c-torture/execute/pr43220.c >=== >--- gcc/testsuite/gcc.c-torture/execute/pr43220.c (revision 207817) >+++ gcc/testsuite/gcc.c-torture/execute/pr43220.c (working copy) >@@ -3,7 +3,7 @@ > int > main (void) > { >- int n = 0; >+ long int n = 0; > lab:; > { > int x[n % 1000 + 1]; >Index: gcc/testsuite/gcc.c-torture/execute/pr58570.c >=== >--- gcc/testsuite/gcc.c-torture/execute/pr58570.c (revision 207817) >+++ gcc/testsuite/gcc.c-torture/execute/pr58570.c (working copy) >@@ -2,7 +2,7 @@ > struct S > { > int f0:15; >- int f1:29; >+ long int f1:29; > }; > > int e = 1, i; >Index: gcc/testsuite/gcc.c-torture/unsorted/DFcmp.c >=== >--- gcc/testsuite/gcc.c-torture/unsorted/DFcmp.c (revision 207817) >+++ gcc/testsuite/gcc.c-torture/unsorted/DFcmp.c (working copy) >@@ -22,6 +22,17 @@ > #define adrx1 (E1[x1]) > #define regx1 (p1[x1]) > >+#if __SIZEOF_INT__ <= 2 >+#undef E0 >+#define E0 ((type *)1) >+#undef adrreg0 >+#define adrreg0 (p0[1]) >+#undef E1 >+#define E1 ((type *)( & ~(__alignof__ (type) - 1))) >+#undef adrreg1 >+#define adrreg1 (p1[/4]) >+#endif >+ > reg0reg1 (r0, r1, x0, x1, p0, p1) > type r0, r1; type *p0, *p1; > {if (reg0 <= reg1) return 1; else return 0;} >Index: gcc/testsuite/gcc.c-torture/unsorted/SFset.c >=== >--- gcc/testsuite/gcc.c-torture/unsorted/SFset.c (revision 207817) >+++ gcc/testsuite/gcc.c-torture/unsorted/SFset.c (working copy) >@@ -18,6 +18,17 @@ > #define adrx1 (E1[x1]) > #define regx1 (p1[x1]) > >+#if __SIZEOF_INT__ <= 2 >+#undef E0 >+#define E0 ((type *)1) >+#undef adrreg0 >+#define adrreg0 (p0[1]) >+#undef E1 >+#define E1 ((type *)( & ~(__alignof__ (type) - 1))) >+#undef adrreg1 >+#define adrreg1 (p1[/4]) >+#endif >+ > int glob0, glob1; > > #define type float >Index: gcc/testsuite/gcc.dg/graphite/pr46966.c >=== >--- gcc/testsuite/gcc.dg/graphite/pr46966.c(revision 207817) >+++ gcc/testsuite/gcc.dg/graphite/pr46966.c(working copy) >@@ -1,5 +1,7 @@ > /* PR tree-optimization/46966 */ > /* { dg-do compile } */ >+/* This test is too big for small targets. */ >+/* { dg-require-effective-target size32plus } */ >/* { dg-options "-O -floop-interchange -ffast-math -fno-tree-copy-prop >-fno-tree-loop-im" } */ > > int a[1000][1000]; >Index: gcc/testsuite/gcc.dg/pr23623.c >=== >--- gcc/testsuite/gcc.dg/pr23623.c (revision 207817) >+++ gcc/testsuite/gcc.dg/pr23623.c (working copy) >@@ -8,19 +8,19 @@ > extern struct > { > unsigned int b : 1; >- unsigned int : 31; >+ unsigned long
Re: [PATCH] Properly check for _Cilk_spawn in return stmt (PR c/60197)
On Mon, Feb 17, 2014 at 05:51:08PM +, Iyer, Balaji V wrote: > > Regtested/bootstrapped on x86_64-linux, ok for 5.0? > > 5.0? you mean 4.9 right?... since this is a minor bug-fix. No, I meant 5.0, since this isn't a regression. But maybe it could go even into 4.9. RM's call. > I would move these two functions to cilk.c file instead of > array-notations-common.c since cilk.c contains all Cilk keyword handling > routines. Ok, moved. > > diff --git gcc/c-family/c-common.h gcc/c-family/c-common.h index > > f074ab1..6f2c6b7 100644 > > --- gcc/c-family/c-common.h > > +++ gcc/c-family/c-common.h > > @@ -1375,6 +1375,7 @@ extern void cilkplus_extract_an_triplets (vec > va_gc> *, size_t, size_t, > > vec > *); > > extern vec *fix_sec_implicit_args > >(location_t, vec *, vec, size_t, tree); > > +extern bool contains_cilk_spawn_stmt (tree); > > > > ...and put the prototype under /* In Cilk.c. */ part). This as well. > Other than the two above comments, the patch looks OK to me. But I don't have > approval rights. I assume it doesn't break any existing regressions in the > cilk-plus suite (doesn't look like it though)? Yeah, it passed regtesting. Note that we also ICE on e.g. int foo (void) { int i; i = (_Cilk_spawn foo ()) + 1; return i; } I don't know whether this is valid use of _Cilk_spawn though. In any case, this patch addresses only _Cilk_spawn in return statements. 2014-02-17 Marek Polacek PR c/60197 c-family/ * cilk.c (contains_cilk_spawn_stmt): New function. (contains_cilk_spawn_stmt_walker): Likewise. * c-common.h (contains_cilk_spawn_stmt): Add declaration. c/ * c-typeck.c (c_finish_return): Call contains_cilk_spawn_stmt instead of checking tree code. cp/ * typeck.c (check_return_expr): Call contains_cilk_spawn_stmt instead of checking tree code. testsuite/ * c-c++-common/cilk-plus/CK/pr60197.c: New test. diff --git gcc/c-family/c-common.h gcc/c-family/c-common.h index f074ab1..1099b10 100644 --- gcc/c-family/c-common.h +++ gcc/c-family/c-common.h @@ -1389,4 +1389,5 @@ extern tree make_cilk_frame (tree); extern tree create_cilk_function_exit (tree, bool, bool); extern tree cilk_install_body_pedigree_operations (tree); extern void cilk_outline (tree, tree *, void *); +extern bool contains_cilk_spawn_stmt (tree); #endif /* ! GCC_C_COMMON_H */ diff --git gcc/c-family/cilk.c gcc/c-family/cilk.c index f2179dfc..13cebf8 100644 --- gcc/c-family/cilk.c +++ gcc/c-family/cilk.c @@ -1292,3 +1292,25 @@ build_cilk_sync (void) TREE_SIDE_EFFECTS (sync) = 1; return sync; } + +/* Helper for contains_cilk_spawn_stmt, callback for walk_tree. Return + non-null tree if TP contains CILK_SPAWN_STMT. */ + +static tree +contains_cilk_spawn_stmt_walker (tree *tp, int *, void *) +{ + if (TREE_CODE (*tp) == CILK_SPAWN_STMT) +return *tp; + else +return NULL_TREE; +} + +/* Returns true if EXPR or any of its subtrees contain CILK_SPAWN_STMT + node. */ + +bool +contains_cilk_spawn_stmt (tree expr) +{ + return walk_tree (&expr, contains_cilk_spawn_stmt_walker, NULL, NULL) +!= NULL_TREE; +} diff --git gcc/c/c-typeck.c gcc/c/c-typeck.c index da6a6fc..23cdb0e 100644 --- gcc/c/c-typeck.c +++ gcc/c/c-typeck.c @@ -9134,7 +9134,7 @@ c_finish_return (location_t loc, tree retval, tree origtype) return error_mark_node; } } - if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT) + if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval)) { error_at (loc, "use of %<_Cilk_spawn%> in a return statement is not " "allowed"); diff --git gcc/cp/typeck.c gcc/cp/typeck.c index 5fc0e6b..566411f 100644 --- gcc/cp/typeck.c +++ gcc/cp/typeck.c @@ -8328,7 +8328,7 @@ check_return_expr (tree retval, bool *no_warning) *no_warning = false; - if (flag_cilkplus && retval && TREE_CODE (retval) == CILK_SPAWN_STMT) + if (flag_cilkplus && retval && contains_cilk_spawn_stmt (retval)) { error_at (EXPR_LOCATION (retval), "use of %<_Cilk_spawn%> in a return " "statement is not allowed"); diff --git gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c index e69de29..2b47d1e 100644 --- gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c +++ gcc/testsuite/c-c++-common/cilk-plus/CK/pr60197.c @@ -0,0 +1,66 @@ +/* PR c/60197 */ +/* { dg-do compile } */ +/* { dg-options "-fcilkplus" } */ + +extern int foo (void); +extern int bar (int); + +int +fn1 (void) +{ + return (_Cilk_spawn foo ()) * 2; /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn2 (void) +{ + return (_Cilk_spawn foo ()) > 2; /* { dg-error "in a return statement is not allowed" } */ +} + +int +fn3 (int i, int j, int k) +{ + return ((_Cilk_spawn foo () + i) - j) * k) / j) | i) ^ k) ; /* { dg-error "in a return statement is not allowed" } */ +} +
Re: [Patch, Fortran, Regression] PR 60231: ICE on undefined generic
Janus Weil wrote: attached is a patch for an ICE-on-invalid problem with generics: We simply don't check if any dummy args are present. There is something odd with your test case - and possibly with the patch. You state that this is an ICE-on-invalid problem; however, I do not see a dg-error in your test case. Tobias Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8? Cheers, Janus 2014-02-17 Janus Weil PR fortran/60231 * resolve.c (check_generic_tbp_ambiguity): Check for presence of dummy arguments to prevent ICE. 2014-02-17 Janus Weil PR fortran/60231 * gfortran.dg/typebound_generic_15.f90: New.
Re: Fix three issues in ipa-prop
> Hi, > > On Mon, Feb 17, 2014 at 09:40:40AM +0100, Jan Hubicka wrote: > > Hi, > > Chromium LTO build ICEs on bogus get_binfo_at_offset call. This is caused by > > updating pasto bug in update_jump_functions_after_inlining. > > > > While looking for it I noticed we have other issues here. In particular, > > when > > combining -fno-devirtualize and -fdevirtualize units, we get all jump > > fuctions > > as type preserved. This is because detect_type_change returns false when it > > decides detection is not needed. It really should return true. Otherwise we > > will > > end up propagating invalid types through the -fno-devirtualize function and > > produce > > wrong code at LTO. > > > > I also added some sanity checking to jump functions while hunting the bug > > that > > uncovered another problem in compute_complex_assign_jump_func and > > compute_complex_ancestor_jump_func that are still confusing type of > > parameter > > (that is pointer) to type of object passed by reference. > > > > I also made us to not save the type to ipa_set_ancestor_jf when type is not > > preserved, since it will never be used for enything useful. > > ipa_get_jf_ancestor_result > > uses to build it the updated address, but we can safely use > > pointer_type_node, > > because it will be converted at the substitution time anyway. > > > > Bootstrapped/regtested x86_64-linux, will commit it tomorrow after some > > furhter testing > > and unless Martin stops me ;) > > > > Honza > > > > * ipa-cp.c (ipa_get_jf_ancestor_result): Allow type to be NULL. > > * ipa-prop.c (ipa_set_jf_known_type): Do not set anyting when > > we do not devirtualize. > > (ipa_set_ancestor_jf): Likewise; do not record type when we do not > > devirtualize. > > (detect_type_change): Signalize type change when giving up on > > detection. > > (compute_complex_assign_jump_func): Fix call of ipa_set_ancestor_jf. > > (compute_complex_ancestor_jump_func): Likewise. > > (update_jump_functions_after_inlining): Fix combining of PASS_THROUGH > > and KNOWN_TYPE. > > This is fine, except that if we allow having NULL as the type of > ancestor jump functions, this should be stated and explained in a > comment in ipa_ancestor_jf_data in ipa-prop.h. I will update the comment prior comitting, thanks! Basically we want to be cureful about what information we store, since it all has to go cross the pipes to linktime compilation stage. Honza > > Thanks, > > Martin
Re: [Patch, Fortran, Regression] PR 60231: ICE on undefined generic
2014-02-17 21:36 GMT+01:00 Tobias Burnus : > Janus Weil wrote: >> >> attached is a patch for an ICE-on-invalid problem with generics: We >> simply don't check if any dummy args are present. > > There is something odd with your test case - and possibly with the patch. > You state that this is an ICE-on-invalid problem; however, I do not see a > dg-error in your test case. Oh yes, sorry. I simply forgot the dg-errors. Thanks for noticing. Updated test cases attached. The errors one gets with the patch (as with 4.7) are the following: typebound_generic_15.f90:13.21: generic :: Add => Add1, Add2 ! { dg-error "are ambiguous" } 1 Error: 'add1' and 'add2' for GENERIC 'add' at (1) are ambiguous typebound_generic_15.f90:11.13: procedure :: Add1 ! { dg-error "must be a module procedure" } 1 Error: 'add1' must be a module procedure or an external procedure with an explicit interface at (1) typebound_generic_15.f90:12.13: procedure :: Add2 ! { dg-error "must be a module procedure" } 1 Error: 'add2' must be a module procedure or an external procedure with an explicit interface at (1) You think there's also something wrong with the patch? Cheers, Janus >> Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8? >> >> Cheers, >> Janus >> >> >> 2014-02-17 Janus Weil >> >> PR fortran/60231 >> * resolve.c (check_generic_tbp_ambiguity): Check for presence of >> dummy >> arguments to prevent ICE. >> >> >> 2014-02-17 Janus Weil >> >> PR fortran/60231 >> * gfortran.dg/typebound_generic_15.f90: New. > > ! { dg-do compile } ! ! PR 60231: [4.8/4.9 Regression] ICE on undefined generic ! ! Contributed by Antony Lewis module Objects Type TObjectList contains procedure :: Add1 ! { dg-error "must be a module procedure" } procedure :: Add2 ! { dg-error "must be a module procedure" } generic :: Add => Add1, Add2 ! { dg-error "are ambiguous" } end Type end module ! { dg-final { cleanup-modules "Objects" } }
Re: [Patch, Fortran, Regression] PR 60231: ICE on undefined generic
Am 17.02.2014 21:51, schrieb Janus Weil: 2014-02-17 21:36 GMT+01:00 Tobias Burnus : Janus Weil wrote: attached is a patch for an ICE-on-invalid problem with generics: We simply don't check if any dummy args are present. There is something odd with your test case - and possibly with the patch. You state that this is an ICE-on-invalid problem; however, I do not see a dg-error in your test case. Oh yes, sorry. I simply forgot the dg-errors. Thanks for noticing. Updated test cases attached. That way, it makes more sense. I have now also looked at your patch and it is OK. Thanks! Tobias The errors one gets with the patch (as with 4.7) are the following: typebound_generic_15.f90:13.21: generic :: Add => Add1, Add2 ! { dg-error "are ambiguous" } 1 Error: 'add1' and 'add2' for GENERIC 'add' at (1) are ambiguous typebound_generic_15.f90:11.13: procedure :: Add1 ! { dg-error "must be a module procedure" } 1 Error: 'add1' must be a module procedure or an external procedure with an explicit interface at (1) typebound_generic_15.f90:12.13: procedure :: Add2 ! { dg-error "must be a module procedure" } 1 Error: 'add2' must be a module procedure or an external procedure with an explicit interface at (1) You think there's also something wrong with the patch? Cheers, Janus Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8? Cheers, Janus 2014-02-17 Janus Weil PR fortran/60231 * resolve.c (check_generic_tbp_ambiguity): Check for presence of dummy arguments to prevent ICE. 2014-02-17 Janus Weil PR fortran/60231 * gfortran.dg/typebound_generic_15.f90: New.
Re: [PATCH] Fix -march=native (PR driver/60233)
On Mon, Feb 17, 2014 at 8:34 PM, Jakub Jelinek wrote: > As discussed in the PR, because -mf16c implies -mavx, if the CPU has > F16C (and AVX) support, but OS doesn't save YMM state, we shouldn't > be passing -mf16c. > > Also, as noticed by Uros, the clearing of has_fma4 and has_xop if > OS doesn't save YMM state was done before it was set. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2014-02-17 Jakub Jelinek > Uros Bizjak > > PR driver/60233 > * config/i386/driver-i386.c (host_detect_local_cpu): If > YMM state is not saved by the OS, also clear has_f16c. Move > CPUID 0x8001 handling before YMM state saving checking. OK for mainline and release branches. Thanks, Uros.
Re: [Patch, Fortran, Regression] PR 60231: ICE on undefined generic
2014-02-18 7:56 GMT+01:00 Tobias Burnus : > > Am 17.02.2014 21:51, schrieb Janus Weil: > >> 2014-02-17 21:36 GMT+01:00 Tobias Burnus : >>> >>> Janus Weil wrote: attached is a patch for an ICE-on-invalid problem with generics: We simply don't check if any dummy args are present. >>> >>> There is something odd with your test case - and possibly with the patch. >>> You state that this is an ICE-on-invalid problem; however, I do not see a >>> dg-error in your test case. >> >> Oh yes, sorry. I simply forgot the dg-errors. Thanks for noticing. >> Updated test cases attached. > > > That way, it makes more sense. I have now also looked at your patch and it > is OK. Thanks! Thanks for the review. Committed to trunk as r207836. Will do 4.8 soon. Cheers, Janus >> The errors one gets with the patch (as with 4.7) are the following: >> >> >> typebound_generic_15.f90:13.21: >> >> generic :: Add => Add1, Add2 ! { dg-error "are ambiguous" } >> 1 >> Error: 'add1' and 'add2' for GENERIC 'add' at (1) are ambiguous >> typebound_generic_15.f90:11.13: >> >> procedure :: Add1 ! { dg-error "must be a module >> procedure" } >> 1 >> Error: 'add1' must be a module procedure or an external procedure with >> an explicit interface at (1) >> typebound_generic_15.f90:12.13: >> >> procedure :: Add2 ! { dg-error "must be a module >> procedure" } >> 1 >> Error: 'add2' must be a module procedure or an external procedure with >> an explicit interface at (1) >> >> >> You think there's also something wrong with the patch? >> >> Cheers, >> Janus >> >> >> Regtested on x86_64-unknown-linux-gnu. Ok for trunk and 4.8? Cheers, Janus 2014-02-17 Janus Weil PR fortran/60231 * resolve.c (check_generic_tbp_ambiguity): Check for presence of dummy arguments to prevent ICE. 2014-02-17 Janus Weil PR fortran/60231 * gfortran.dg/typebound_generic_15.f90: New. >>> >>> >