Mixing -fcf-protection and -fcf-protection=none objects are allowed.
Linker just merges -fcf-protection values from all input objects.
Add -fcf-protection=check for the final link with LTO. An error is
issued if LTO object files are compiled with different -fcf-protection
values. Otherwise, -fcf-protection=check is ignored at the compile
time. Without explicit -fcf-protection at link time, -fcf-protection
values from LTO object files are merged at the final link.
gcc/
PR bootstrap/96203
* common.opt: Add -fcf-protection=check.
* flag-types.h (cf_protection_level): Add CF_CHECK.
* lto-wrapper.c (merge_and_complain): Issue an error for
mismatching -fcf-protection values with -fcf-protection=check.
Otherwise, merge -fcf-protection values.
* doc/invoke.texi: Document -fcf-protection=check.
gcc/testsuite/
PR bootstrap/96203
* gcc.target/i386/pr96203-1.c: New test.
* gcc.target/i386/pr96203-2.c: Likewise.
gcc/ada/
* sem_res.adb (Resolve_Actuals): Restrict the check on matching
aliased components to view conversions of array types that are
not placed in an instance. In such case at runtime an object is
created.
* sem_util.ads (Is_Actual_In_Out_Parameter, Is_View_Conversion):
New subprograms.
* sem_util.adb (Is_Actual_In_Out_Parameter, Is_View_Conversion):
New subprograms.
gcc/ada/
* exp_ch6.adb (Expand_Call_Helper): Modify addition of the extra
accessibility parameter to take into account the extra
accessibility of formals within the calling subprogram.
gcc/ada/
* errout.ads, errout.adb (Error_Msg_Ada_2020_Feature): New
procedure analogous to Error_Msg_Ada_2012_Feature.
* sem_attr.adb (Analyze_Image_Attribute): Use
Error_Msg_Ada_2012_Feature and Error_Msg_Ada_2020_Feature to
indicate that Object'Image is allowed in Ada 2012, and that
'Image is allowed for any type in Ada 2020.
gcc/ada/
* libgnat/a-strunb.adb (Sum, Mul, Saturated_Sum, Saturated_Mul):
New routines. Use them when resulting string size more that
length of the strings in parameters.
(Unbounded_Slice): Use "- 1" instead of "+ 1" in opposite side
of condition to avoid overflow.
* libgnat/a-strunb__shared.adb (Sum, Mul): New routines.
(Allocate): New routine with 2 parameters. Use routine above
when resulting string size more that length of the strings in
parameters.
(Aligned_Max_Length): Do not try to align to more than Natural'Last.
(Unbounded_Slice): Use "- 1" instead of "+ 1" in opposite side
of condition to avoid overflow.
gcc/ada/
* sem_prag.adb (Analyze_Pragma, Pragma_Max_Entry_Queue_Length):
Refine error message to indicate that the pragma must apply to
an entry declaration, not just an entry.
gcc/ada/
* exp_ch6.adb (Make_Build_In_Place_Iface_Call_In_Allocator):
Revert previous patch, and add a missing type conversion to
displace the pointer to the allocated object to reference the
target dispatch table.
gcc/ada/
* sem_res.adb (Resolve_Actuals): Restore restrictive check on
view conversions which required matching value of
Has_Aliased_Components of formals and actuals. Required to avoid
the regression of ACATS b460005.
gcc/ada/
* sem_ch12.adb (Instantiate_Package_Body): Add commentary for a
nesting issue with parent handling and private view switching.
(Switch_View): Do not skip specific private-dependent subtypes.
gcc/ada/
* sem_ch13.adb (Analyze_Address_Specification_Clause): Do not
emit a warning when a constant declaration in a generic unit
overlays a generic In_Parameter.
gcc/ada/
* sem_ch3.adb (Check_Abstract_Overriding): Remove Scope
comparison test from test related to initial implementation of
AI12-0042, plus remove the related ??? comment.
(Derive_Subprogram): Add test requiring that the type extension
appear in the visible part of its enclosing package when
checking the overriding requirement of 7.3.2(6.1/4), as
clarified by AI12-0382.
gcc/ada/
* libgnat/s-rannum.ads, libgnat/s-rannum.adb: Add Put_Image.
This will be inherited by the language-defined packages
Ada.Numerics.Discrete_Random and Ada.Numerics.Float_Random.
* libgnat/a-convec.ads, libgnat/a-convec.adb: Add Put_Image.
* libgnat/s-putima.ads: Add pragma Preelaborate, so this can be
imported into containers packages.
* libgnat/s-putima.adb: Move Digit to private part; otherwise
reference to Base is illegal in Preelaborate generic.
* exp_put_image.adb (Build_Record_Put_Image_Procedure): Use the
base type.
gcc/ChangeLog:
PR lto/45375
* symbol-summary.h: Call vec_safe_reserve before grow is called
in order to grow to a reasonable size.
* vec.h (vec_safe_reserve): Add missing function for vl_ptr
type.
Again, the variables are "privatized" using ASM_PN_FORMAT for MMIX (but
apparently not for other targets) and the line to match looks like:
D.1427 = VEC_PERM_EXPR <a::0, b::1, { 0, 4, 1, 5 }>;
gcc/testsuite:
* gcc.dg/tree-ssa/vector-4.c: Adjust for mmix.
The variables are "localized" using ASM_PN_FORMAT for MMIX and the
lines to match look like:
Deleted dead store: y::4 = y;
Deleted dead store: x::3 = x;
gcc/testsuite:
* gcc.dg/tree-ssa/ssa-dse-26.c: Adjust for mmix.
Looking at the dump and the test, I guess all "64-bit targets" fail
the test for the reasons seen in the comment just above the dg-final,
whose last two lines make it to the patch context. Maybe the xfail
target list can be shortened by removing most targets and use just
"lp64". That doesn't cover it passing on x86_64 and s390x-zarch
though.
gcc/testsuite:
* gcc.dg/tree-ssa/ssa-dom-cse-2.c: xfail scan for mmix.
The expression of interest looks like "e_5 = a::0_1 + b::1_2;" for
mmix-knuth-mmixware, while other targets have a "." instead of the
"::". ISTM the most useful change here is not to disable the test,
but to add an optional character in the matched expression to match
the "extra" ":". Also checked cris-elf to assert that the expression
still passes for an "ordinary" ELF target.
gcc/testsuite:
* gcc.dg/tree-ssa/reassoc-20.c: Adjust for mmix.
In 2012 e2769e908a915ebbc/r192344, I added the following lines, that I
now delete. I've changed my mind: ELF-related targets based on gas,
that support only static linking, have .hidden "for free", regardless
of the visibility of the hidden object in the linked executable. No
regressions for mmix-knuth-mmixware and "fixes":
FAIL: gcc.dg/torture/pr94947-1.c -O2 -flto -fuse-linker-plugin -fno-fat-lto-objects (test for excess errors)
Excess errors:
lto1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
...a warning which is emitted for "all" LTO tests (of which most have
warnings filtered out); LTO "thinks" all supported targets have
.hidden support.
gcc:
* configure.ac (out-of-tree linker .hidden support): Don't turn off
for mmix-knuth-mmixware.
* configure: Regenerate.
This option is mostly being added to provide -mno-block-ops-unaligned-vsx.
The default is set the same as -mefficient-unaligned-vsx. This option will
control the use of unaligned VSX loads/stores in the inline expansion
of memcpy() and memmove(). The use case for this would be if you're
compiling code that is doing a memcpy to memory mapped device memory
that is cache-inhibited. On some powerpc processors this requires the
unaligned vsx ops to be emulated by the kernel which is very slow.
gcc/ChangeLog:
* config/rs6000/rs6000.c (rs6000_option_override_internal):
Set the default value for -mblock-ops-unaligned-vsx.
* config/rs6000/rs6000.opt: Add -mblock-ops-unaligned-vsx.
* doc/invoke.texi: Document -mblock-ops-unaligned-vsx.
libgfortran/ChangeLog:
PR target/96306
* configure.ac: Add LIBGOMP_CHECKED_INT_KINDS and
LIBGOMP_CHECKED_REAL_KINDS and use it for to skip
integer kind=16 checks for amdgcn.
* Makefile.am (kinds.h, selected_int_kind.inc,
selected_real_kind.inc): Pass them on.
* mk-kinds-h.sh: Takes to-be-check kinds as argument.
* mk-sik-inc.sh: Likewise.
* mk-srk-inc.sh: Likewise.
* Makefile.in: Regenerate.
* configure: Regenerate.
The label of interest here is "b.0_2" for
e.g. x86_64-pc-linux-gnu but "b::1_2" for mmix-knuth-mmixware.
The test seems to be of some interest for mmix (hey, gcc
open-coded 128-bit integer support behind my back!) so I didn't
want to just disable it. I also didn't want to obscure the
matching pattern by generalizing it, so instead I added a
separate matching pattern.
gcc/testsuite:
* gcc.dg/tree-ssa/forwprop-36.c: Adjust for mmix.
With the dejagnu status-wrapper, there's a reference to write in
each executable, which for mmix in newlib has a reference to a
variable defined in open, which for mmix in newlib has a
reference to sprintf (oops!) and the dependency-chain goes on;
ad finitum there's a reference to malloc, which in default
newlib is colocated with free; the same file
newlib/libc/stdlib/malloc.c.
Not being compiled with -ffunction-sections, they're emitted in
the same section (.text) and thus inseparable: you can't
override just one of them as in this test, or else you'll get:
<X>/pre/mmix/bin/ld: <X>/gccobj/mmix/./newlib/libc.a(lib_a-malloc.o): in function `free':
<X>/gcc/newlib/libc/stdlib/malloc.c:169: multiple definition of `free'; /tmp/ccvRA0zb.o:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
compiler exited with status 1
FAIL: gcc.dg/torture/pr59330.c -O0 (test for excess errors)
I'm using a dg-skip-if here instead of starting a hardly
scalable dg-do target selector. I'm not keying on
effective-target unwrapped because the dependency-chain is
target-specific rather than dejagnu status-wrapper-specific.
gcc/testsuite:
* gcc.dg/torture/pr59330.c: Disable for mmix.
Funny that default_asm_output_ident_directive isn't the default...
Anyway, since dot-pseudos like .ident are treated as comments by
mmixal, there's nothing lost compatibilitywise by supporting it.
If mmix-knuth-mmixware had included elfos.h this'd have been the
default. There might be enough reason to do that; relocatable objects
are ELF but (by default) links to produce mmo. Fixes
c-c++-common/ident-1b.c and 2b in C and C++ testing. Committed.
gcc:
* config/mmix/mmix.c (TARGET_ASM_OUTPUT_IDENT): Override the default
with default_asm_output_ident_directive.
Darwin's static linker expects, by default, that all linkage will
be satisfied (even for weak items). This allows the two-level
namespace to work even for weak cases.
However, there's an option to make it behave in a similar manner
to ELF. This is needed for the pure-virtual1.C testcase to pass
on Darwin.
gcc/testsuite/ChangeLog:
* g++.dg/abi/pure-virtual1.C: Add dynamic_lookup option
for Darwin.
This enables types __int128 et al for move, add, subtract, and logical
operations. At least shift, rotate, multiple, divide, and modulus are broken
so we can expect some test failures.
This is required now because libgomp no longer builds without __int128.
An additional patch will be required to unbreak the libgfortran build.
gcc/ChangeLog:
* config/gcn/gcn.c (gcn_scalar_mode_supported_p): New function.
(TARGET_SCALAR_MODE_SUPPORTED_P): New define.
gcc/ChangeLog:
2020-07-24 David Edelsohn <dje.gcc@gmail.com>
Clement Chigot <clement.chigot@atos.net>
* config.gcc (powerpc-ibm-aix7.1): Use t-aix64 and biarch64 for
cpu_is_64bit.
* config/rs6000/aix71.h (ASM_SPEC): Remove aix64 option.
(ASM_SPEC32): New.
(ASM_SPEC64): New.
(ASM_CPU_SPEC): Remove vsx and altivec options.
(CPP_SPEC_COMMON): Rename from CPP_SPEC.
(CPP_SPEC32): New.
(CPP_SPEC64): New.
(CPLUSPLUS_CPP_SPEC): Rename to CPLUSPLUS_CPP_SPEC_COMMON..
(TARGET_DEFAULT): Use 64 bit mask if BIARCH.
(LIB_SPEC_COMMON): Rename from LIB_SPEC.
(LIB_SPEC32): New.
(LIB_SPEC64): New.
(LINK_SPEC_COMMON): Rename from LINK_SPEC.
(LINK_SPEC32): New.
(LINK_SPEC64): New.
(STARTFILE_SPEC): Add 64 bit version of crtcxa and crtdbase.
(ASM_SPEC): Define 32 and 64 bit alternatives using DEFAULT_ARCH64_P.
(CPP_SPEC): Same.
(CPLUSPLUS_CPP_SPEC): Same.
(LIB_SPEC): Same.
(LINK_SPEC): Same.
(SUBTARGET_EXTRA_SPECS): Add new 32/64 specs.
* config/rs6000/aix72.h (TARGET_DEFAULT): Use 64 bit mask if BIARCH.
* config/rs6000/defaultaix64.h: Delete.
The only way to enable or disable Power10 insns (ISA 3.1 insns) should
be via the -mcpu= switch. This patch disables the -mpower10 options the
same way the -mdirect-move switch is neutered already. That is not an
ideal way, but it works, it is not the first, and doing it properly is
more work, and will happen later.
2020-07-24 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.opt: Delete -mpower10.
gcc/testsuite/
* gcc.target/powerpc/pr95907.c: New.
There's no reason anyone would want to use the "patchable function"
feature for MMIX and also no reason to exclude those tests. For MMIX,
the NOP equivalent is SWYM ("swymming" is a healthy exercise).
Text-wise, making the tests pass by adjusting the regexp, is shorter,
and it seems unlikely to both appear as a mnemonic for other targets
*and* being emitted in uppercase.
gcc/testsuite:
* c-c++-common/patchable_function_entry-decl.c,
c-c++-common/patchable_function_entry-default.c,
c-c++-common/patchable_function_entry-definition.c: Adjust for mmix.
This test case, extracted from PR 95645, was failing because alignment
of local long long variable got lowered from 8 bytes to 4 bytes in
adjust alignment pass, which triggered assert failure.
This test case passes now because PR 95237 fix only allows lowering of
alignment of local variables in the front end. As a result, alignment
of local long long variable no longer gets lowered in adjust alignment
pass.
gcc/testsuite/ChangeLog:
PR target/96192
* c-c++-common/pr96192-1.c: New test.
Offload tests that scan dump files may run multiple times, once per
offload target, but the test result messages do not mention the
offload target, so we may seem to have repeated results. Fixed by
modifying the test name so that it contains the offload target name.
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
for gcc/testsuite/ChangeLog
* lib/scanoffload.exp (scoff-testname, scoff-adjust): New.
(scoff): Call them.
Rework intelmic-mkoffload into the new aux and dump file naming
semantics. Obey -save-temps.
Co-Authored-By: Thomas Schwinge <thomas@codesourcery.com>
for gcc/ChangeLog
* config/i386/intelmic-mkoffload.c
(generate_target_descr_file): Use dumppfx for save_temps
files. Pass -dumpbase et al down to the compiler.
(generate_target_offloadend_file): Likewise.
(generate_host_descr_file): Likewise.
(prepare_target_image): Likewise. Move out_obj_filename
setting...
(main): ... here. Detect -dumpbase, set dumppfx too.
The initial bug report was that compiling (-c) with -dumpbase ""
-dumpbase-ext .<ext> crashes the driver.
The verification of -dumpbase-ext against -dumpbase doesn't cover the
case in which -dumpbase activates backward-compatibility mode.
I added a test for that, and for -dumpbase-ext without -dumpbase,
trying to make it work in a sensible way, as if applied to the default
-dumpbase for each file. It turned out that this made for too much
complexity in dealing with suffixes derived from input filenames, so I
gave that up and returned to discarding -dumpbase-ext as documented,
ending up with a change identical to that in the original bug report.
I also thought I caught an off-by-one error in the initial
verification, that caused dumpbase_ext to be discarded if it was
identical to the specified dumpbase, but that turned out to be
intentional as well, so I put in comments and a test to reflect it.
Finally, an earlier version of the newly-added tests used "$var.ext"
in an expected output list, which showed me the handling of string
expansion was incorrect. Reworked the expr into an eval to make that
work, and, absent any reliance on post-eval adjustments to so-expanded
output names, I arranged for the adjustments to be skipped after eval.
Co-Authored-By: "Zhanghaijian (A)" <z.zhanghaijian@huawei.com>
for gcc/ChangeLog
PR driver/96230
* gcc.c (process_command): Adjust and document conditions to
reset dumpbase_ext.
for gcc/testsuite/ChangeLog
PR driver/96230
* gcc.misc-tests/outputs.exp: Add tests with -dumpbase-ext,
with identical -dumpbase, with -dumpbase "", and without any
-dumpbase.
(outest): Fix "" expansion in expected outputs, skip
adjustments.