This patch adds a new pattern, *thumb2_csinc, for generating CSINC
instructions. It also modifies an existing pattern, *thumb2_cond_arith, to
output CINC when the operation is an addition and TARGET_COND_ARITH is true.
gcc/ChangeLog:
* config/arm/thumb2.md (*thumb2_csinc): New.
(*thumb2_cond_arith): Generate CINC where possible.
gcc/testsuite/ChangeLog:
* gcc.target/arm/csinc-1.c: New test.
Co-authored-by: Omar Tahir <omar.tahir@arm.com>
This patch adds a new pattern, *thumb2_csinv, for generating CSINV nstructions.
This pattern relies on a few general changes that will be used throughout
the following patches:
- A new macro, TARGET_COND_ARITH, which is only true on 8.1-M Mainline
and represents the existence of these conditional instructions.
- A change to the cond exec hook, arm_have_conditional_execution, which
now returns false if TARGET_COND_ARITH before reload. This allows for
some ifcvt transformations when they would usually be disabled. I've
written a rather verbose comment (with the risk of over-explaining)
as it's a bit of a confusing change.
- One new predicate.
- *thumb2_movcond has been restricted to only match if !TARGET_COND_ARITH,
otherwise it triggers undesirable combines.
gcc/ChangeLog:
* config/arm/arm.h (TARGET_COND_ARITH): New macro.
* config/arm/arm.c (arm_have_conditional_execution): Return false if
TARGET_COND_ARITH before reload.
* config/arm/predicates.md (arm_comparison_operation): Returns true if
comparing CC_REGNUM with constant zero.
* config/arm/thumb2.md (*thumb2_csinv): New.
(*thumb2_movcond): Don't match if TARGET_COND_ARITH.
gcc/testsuite/ChangeLog:
* gcc.target/arm/csinv-1.c: New test.
Co-authored-by: Omar Tahir <omar.tahir@arm.com>
If the hard frame pointer is being used as a global register,
we should skip the usual handling for eliminations. As the
comment says, the register cannot in that case be eliminated
(or eliminated to) and is already marked live where appropriate.
Doing this removes the duplicate error for gcc.target/i386/pr82673.c.
The “cannot be used in 'asm' here” message is meant to be for asm
statements rather than register asms, and the function that the
error is reported against doesn't use asm.
gcc/
2020-09-18 Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91957
* ira.c (ira_setup_eliminable_regset): Skip the special elimination
handling of the hard frame pointer if the hard frame pointer is fixed.
gcc/testsuite/
2020-09-18 H.J. Lu <hjl.tools@gmail.com>
Richard Sandiford <richard.sandiford@arm.com>
PR middle-end/91957
* g++.target/i386/pr97054.C: New test.
* gcc.target/i386/pr82673.c: Remove redundant extra message.
This time with short and char where the used mask used to be larger
than it should have been.
2020-09-18 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/97081
* gcc.dg/vect/pr97081-2.c: New test.
This corrects the mask for creation of x << s | x >> (-x & mask)
from a rotate x <<r s to use the precision of x.
2020-09-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/97081
* tree-vect-patterns.c (vect_recog_rotate_pattern): Use the
precision of the shifted operand to determine the mask.
* gcc.dg/vect/pr97081.c: New testcase.
The new operand modifiers can be used to select odd-numbered bytes of a memory
reference or constant value.
gcc/ChangeLog:
* config/msp430/msp430.c (msp430_print_operand): Update comment.
Cast to long when printing values formatted as long.
Support 'd', 'e', 'f' and 'g' modifiers.
Extract operand value with a single operation for all modifiers.
* doc/extend.texi (msp430Operandmodifiers): New.
gcc/testsuite/ChangeLog:
* gcc.target/msp430/operand-modifiers.c: Extend test to handle new
modifiers.
* gcc.target/msp430/operand-modifiers-bad.c: New test.
There is no CFA information generated for instructions that manipulate the
stack during function epilogues. This means a debugger cannot determine the
position of variables on the stack whilst the epilogue is in progress.
This can cause the debugger to give erroneous information when printing a
backtrace whilst stepping through the epilogue, or cause software watchpoints
set on stack variables to become invalidated after a function epilogue
is executed.
The patch fixes this by marking stack manipulation insns as
frame_related, and adding reg_note RTXs to stack pop instructions in the
epilogue.
gcc/ChangeLog:
* config/msp430/msp430.c (increment_stack): Mark insns which increment
the stack as frame_related.
(msp430_expand_prologue): Add comments.
(msp430_expand_epilogue): Mark insns which decrement
the stack as frame_related.
Add reg_note to stack pop insns describing position of register
variables on the stack.
This pass only had an optimization for obtaining team/thread numbers in it,
and that turns out to be invalid in the presence of nested parallel regions,
so we can simply delete the whole thing.
Of course, it would be nice to apply the optimization where it is valid, but
that will take more effort than I have to spend right now.
gcc/ChangeLog:
* config/gcn/gcn-tree.c (execute_omp_gcn): Delete.
(make_pass_omp_gcn): Delete.
* config/gcn/t-gcn-hsa (PASSES_EXTRA): Delete.
* config/gcn/gcn-passes.def: Removed.
This simple change rewords a comment in cfgloop.h to improve the grammar
and readability.
gcc/ChangeLog:
* cfgloop.h (nb_iter_bound): Reword comment describing is_exit.
This fixes a typo introduced with the last change and not noticed
because those vectorizer access macros are not type safe ...
2020-09-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/97095
* tree-vect-loop.c (vectorizable_live_operation): Get
the SLP vector type from the correct object.
* gfortran.dg/pr97095.f: New testcase.
This fixes bogus replacing of an unsigned (-x)/y division by
-(x/y).
2020-09-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/97089
* tree-ssa-sccvn.c (visit_nary_op): Do not replace unsigned
divisions.
This fixes a missed early-out in SLP live stmt marking when
all scalar stmts were already visited (oops).
2020-09-18 Richard Biener <rguenther@suse.de>
PR tree-optimization/97098
* tree-vect-slp.c (vect_bb_slp_mark_live_stmts): Do not
recurse to children when all stmts were already visited.
Martin's -Wplacement-new patch ran into a problem with DECL_SIZE not being
set on an extern variable for which the type was not complete until after
its declaration. complete_vars was deliberately not calling layout_decl for
some reason, instead leaving that for expand_expr_real_1 much later in the
compilation. But if we layout decls at declaration time, I don't see any
reason we shouldn't lay them out here, when their type is newly complete.
gcc/cp/ChangeLog:
* decl.c (complete_vars): Call layout_var_decl.
Consider test-case gcc.c-torture/compile/pr71109.c.
It contains a prototype-less declaration of foo:
...
static void foo ();
...
followed by a call to foo
...
foo (bar, a);
...
followed by the definition of foo:
...
static inline void
foo (int x, struct S y, struct T z)
...
The test-case has undefined behaviour, but for the nvptx target it doesn't even
assemble:
...
$ gcc src/gcc/testsuite/gcc.c-torture/compile/pr71109.c -c
ptxas pr71109.o, line 196; error : Type of argument does not match \
formal parameter '%in_ar0'
ptxas pr71109.o, line 196; error : Alignment of argument does not match \
formal parameter '%in_ar0'
ptxas pr71109.o, line 196; error : Call has wrong number of parameters
ptxas fatal : Ptx assembly aborted due to errors
nvptx-as: ptxas returned 255 exit status
...
The problem is that this call:
...
191 {
192 .param .u64 %out_arg1;
193 st.param.u64 [%out_arg1],%r23;
194 .param .u64 %out_arg2;
195 st.param.u64 [%out_arg2],%r32;
196 call foo,(%out_arg1,%out_arg2);
197 }
...
does not match the preceding declaration:
...
6 // BEGIN FUNCTION DECL: foo
7 .func foo (.param .u32 %in_ar0, .param .u64 %in_ar1, .param .u64 %in_ar2);
...
which is a PTX error.
Introduce an effective target non_strict_prototype that returns 0 for nvptx,
and use it in this and similar test-cases.
Tested on nvptx.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp (check_effective_target_non_strict_prototype):
New proc.
* gcc.c-torture/compile/pr71109.c: Require effective target
non_strict_prototype.
* gcc.c-torture/compile/pr83051-2.c: Same.
* gcc.c-torture/compile/pr89663-1.c: Same.
* gcc.c-torture/compile/pr89663-2.c: Same.
* gcc.c-torture/compile/pr96796.c: Same.
Bugzilla inspection turned up a bunch of old(er) PRs that have been
fixed. Let's include them not to regress in the future.
gcc/testsuite/ChangeLog:
PR c++/87530
PR c++/58156
PR c++/68828
PR c++/86002
PR c++/91525
PR c++/96223
PR c++/87032
PR c++/35098
* g++.dg/cpp0x/move-return4.C: New test.
* g++.dg/cpp0x/vt-58156.C: New test.
* g++.dg/cpp2a/concepts-pr68828.C: New test.
* g++.dg/cpp2a/concepts-pr86002.C: New test.
* g++.dg/cpp2a/concepts-pr91525.C: New test.
* g++.dg/cpp2a/constexpr-indeterminate1.C: New test.
* g++.dg/cpp2a/desig17.C: New test.
* g++.dg/ext/attrib62.C: New test.
ptrace is actually declared as a variadic function. On ppc64le
the ABI requires to the caller to allocate space for the parameters
and allows the caller to modify them.
On ppc64le, depending on how and what version of GCC is used,
it will save to parameter save area. This happened to clobber
a saved LR, and caused syscall.TestExecPtrace to fail with a timeout
when the tracee segfaults, and waits for the parent process to inspect.
Wrap this function to avoid directly calling glibc's ptrace from go.
Fixesgolang/go#36698
Fixes go/92567
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/254755
Currently the -Wmisleading-indentation warning doesn't do any analysis
when the guarded statement or the statement after it is produced by a
macro. This means we warn for:
if (flag)
foo ();
bar ();
but not for:
#define BAR bar
if (flag)
foo ();
BAR ();
This patch extends the -Wmisleading-indentation implementation to
support analyzing such statements and their tokens. This is done in the
"natural" way by resolving the location of each of the three tokens to
the token's macro expansion point. (Additionally, if the tokens all
resolve to the same macro expansion point then we instead use their
locations within the macro definition.) When these resolved locations
are all different, then we can proceed with applying the warning
heuristics to them as if no macros were involved.
gcc/c-family/ChangeLog:
PR c/80076
* c-indentation.c (should_warn_for_misleading_indentation): Move
declarations of local variables closer to their first use.
Handle virtual token locations by resolving them to their
respective macro expansion points. If all three tokens are
produced from the same macro expansion, then instead use their
loci within the macro definition.
gcc/objc/ChangeLog:
PR c/80076
* objc-gnu-runtime-abi-01.c
(gnu_runtime_abi_01_get_class_super_ref): Reduce indentation of
misleadingly indented return statements.
* objc-next-runtime-abi-01.c
(next_runtime_abi_01_get_class_super_ref): Likewise.
gcc/ChangeLog:
PR c/80076
* gensupport.c (alter_attrs_for_subst_insn) <case SET_ATTR>:
Reduce indentation of misleadingly indented code fragment.
* lra-constraints.c (multi_block_pseudo_p): Likewise.
* sel-sched-ir.c (merge_fences): Likewise.
libcpp/ChangeLog:
PR c/80076
* include/line-map.h (first_map_in_common): Declare.
* line-map.c (first_map_in_common): Remove static.
gcc/testsuite/ChangeLog:
PR c/80076
* c-c++-common/Wmisleading-indentation-5.c: New test.
Some DWARF tests scan the assembly output looking for constant values.
When using DWARF5 those constants might use DW_FORM_implicit_const,
which are output (in the comments) after the attribute instead of
before. To make sure these tests work introduce a -gdwarf-5 variant
of these tests and explicitly use -gdwarf-2 for the original.
gcc/testsuite/ChangeLog:
* gcc.dg/debug/dwarf2/inline2.c: Add -gdwarf-2.
* g++.dg/debug/dwarf2/inline-var-1.C: Likewise.
* gcc.dg/debug/dwarf2/pr41445-5.c: Likewise.
* gcc.dg/debug/dwarf2/pr41445-6.c: Likewise.
* gcc.dg/debug/dwarf2/inline6.c: New variant with -gdwarf-5.
* g++.dg/debug/dwarf2/inline-var-3.C: Likewise.
* gcc.dg/debug/dwarf2/pr41445-7.c: Likewise.
* gcc.dg/debug/dwarf2/pr41445-8.c: Likewise.
Recent Technology Levels of AIX 7.2 have made sys/socket.h more C++-aware,
which causes the fix to be applied in too many locations. This patch adds
more context for the selection to apply the fix more narrowly.
fixincludes/ChangeLog:
2020-09-17 David Edelsohn <dje.gcc@gmail.com>
* inclhack.def (aix_externcpp1): Add more context to select.
(aix_externcpp2): Same.
* fixincl.x: Regenerate.
* tests/base/sys/socket.h: Update expected results.
This patch makes tsubst_requires_expr avoid substituting into a
requires-expression when partially instantiating a generic lambda.
This is necessary in general to ensure that we always check requirements
in lexical order (as in the first testcase below). A mechanism similar
to PACK_EXPANSION_EXTRA_ARGS is added to remember template arguments and
defer substitution of requires-expressions.
Incidentally, this change also fixes the two mentioned PRs -- the
problem there is that tsubst_requires_expr was performing semantic
checks on template trees, and some of the checks are not prepared to
handle such trees. With this patch, tsubst_requires_expr no longer
does any semantic checking at all when processing_template_decl.
gcc/cp/ChangeLog:
PR c++/96409
PR c++/96410
* constraint.cc (tsubst_requires_expr): Use REQUIRES_EXPR_PARMS
and REQUIRES_EXPR_REQS. Use REQUIRES_EXPR_EXTRA_ARGS,
add_extra_args and build_extra_args to defer substitution until
we have all the template arguments.
(finish_requires_expr): Adjust the call to build_min so that
REQUIRES_EXPR_EXTRA_ARGS gets set to NULL_TREE.
* cp-tree.def (REQUIRES_EXPR): Give it a third operand.
* cp-tree.h (REQUIRES_EXPR_PARMS, REQUIRES_EXPR_REQS,
REQUIRES_EXPR_EXTRA_ARGS): Define.
(add_extra_args, build_extra_args): Declare.
gcc/testsuite/ChangeLog:
PR c++/96409
PR c++/96410
* g++.dg/cpp2a/concepts-lambda13.C: New test.
* g++.dg/cpp2a/concepts-lambda14.C: New test.
This patch makes the *_internal functions 'static inline' to avoid these warnings during the build:
/libgcc/config/arm/fp16.c:169:1: warning: no previous prototype for '__gnu_h2f_internal' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:194:1: warning: no previous prototype for '__gnu_f2h_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:200:1: warning: no previous prototype for '__gnu_h2f_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:206:1: warning: no previous prototype for '__gnu_f2h_alternative' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:212:1: warning: no previous prototype for '__gnu_h2f_alternative' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:218:1: warning: no previous prototype for '__gnu_d2h_ieee' [-Wmissing-prototypes]
/libgcc/config/arm/fp16.c:224:1: warning: no previous prototype for '__gnu_d2h_alternative' [-Wmissing-prototypes]
2020-09-11 Torbjörn SVENSSON <torbjorn.svensson@st.com>
Christophe Lyon <christophe.lyon@linaro.org>
libgcc/
* config/arm/fp16.c (__gnu_h2f_internal): Add 'static inline'
qualifier.
(__gnu_f2h_ieee, __gnu_h2f_ieee, __gnu_f2h_alternative)
(__gnu_h2f_alternative,__gnu_d2h_ieee, __gnu_d2h_alternative): Add
missing prototypes.
This adds the capability to look for available negated multiplications
and divisions, replacing them with cheaper negates.
2020-09-17 Richard Biener <rguenther@suse.de>
* tree-ssa-sccvn.c (visit_nary_op): Value-number multiplications
and divisions to negates of available negated forms.
* gcc.dg/tree-ssa/ssa-fre-88.c: New testcase.
gcc/ChangeLog:
PR middle-end/97078
* function.c (use_register_for_decl): Test cfun->tail_call_marked
for a parameter here instead of...
(assign_parm_setup_reg): ...here.
gcc/testsuite/ChangeLog:
* gcc.dg/pr97078.c: New test.
This fixes an ICE when trying to copy a legacy value_range containing
a symbolic to a multi-range:
min = make_ssa_name (type);
max = build_int_cst (type, 55);
value_range vv (min, max);
int_range<2> vr = vv;
gcc/ChangeLog:
* range-op.cc (multi_precision_range_tests): Normalize symbolics when copying to a
multi-range.
* value-range.cc (irange::copy_legacy_range): Add test.
pz_tmp_base and pz_tmp_dot are always set, but used only when
_PC_NAME_MAX is defined.
This patch moves their declaration and definition undef #ifdef
_PC_NAME_MAX to avoid this warning.
2020-09-11 Torbjörn SVENSSON <torbjorn.svensson@st.com>
Christophe Lyon <christophe.lyon@linaro.org>
fixincludes/
* fixfixes.c (pz_tmp_base, pz_tmp_dot): Define only with
_PC_NAME_MAX.
Before the change 'man gcc' rendered "SOURCE_DATE_EPOCH" section as:
... the output of @command{date +%s} on GNU/Linux ...
After the change it renders as:
... the output of "date +%s" on GNU/Linux ...
gcc/ChangeLog:
* doc/cppenv.texi: Use @code{} instead of @samp{@command{}}
around 'date %s'.
Current status is -mno-avx implies -mno-xsave which should be wrong.
gcc/ChangeLog
* common/config/i386/i386-common.c
(OPTION_MASK_ISA_AVX_UNSET): Remove OPTION_MASK_ISA_XSAVE_UNSET.
(OPTION_MASK_ISA_XSAVE_UNSET): Add OPTION_MASK_ISA_AVX_UNSET.
gcc/testsuite/ChangeLog
* gcc.target/i386/xsave-avx-1.c: New test.
Debugging the state explosion of the very large switch statement in
gcc.dg/analyzer/pr96653.c showed that the worklist was failing to
order the exploded nodes correctly; the in-edges at the join point
after the switch were not getting processed together, but were instead
being rocessed in smaller batches, bloating the exploded graph until the
per-point limit was reached.
The root cause turned out to be a bug in creating the strongly-connected
components for the supergraph: the code was considering interprocedural
edges as well as intraprocedural edges, leading to unpredictable
misorderings of the SCC and worklist, leading to bloating of the
exploded graph.
This patch fixes the SCC creation so it only considers intraprocedural
edges within the supergraph. It also tweaks worklist::key_t::cmp to
give higher precedence to call_string over differences within a
supernode, since enodes with different call_strings can't be merges.
In practise, none of my test cases were affected by this latter change,
though it seems to be the right thing to do.
With this patch, the very large switch statement in
gcc.dg/analyzer/pr96653.c is handled in a single call to
exploded_graph::maybe_process_run_of_before_supernode_enodes:
merged 358 in-enodes into 2 out-enode(s) at SN: 402
and that testcase no longer hits the per-program-point limits.
gcc/analyzer/ChangeLog:
* engine.cc (strongly_connected_components::strong_connect): Only
consider intraprocedural edges when creating SCCs.
(worklist::key_t::cmp): Add comment. Treat call_string
differences as more important than differences of program_point
within a supernode.
gcc/testsuite/ChangeLog:
PR analyzer/96653
* gcc.dg/analyzer/loop-0-up-to-n-by-1-with-iter-obj.c: Update
expected number of exploded nodes.
* gcc.dg/analyzer/malloc-vs-local-1a.c: Update expected number
of exploded nodes.
* gcc.dg/analyzer/pr96653.c: Remove -Wno-analyzer-too-complex.
gcc/analyzer/ChangeLog:
* engine.cc (supernode_cluster::dump_dot): Show the SCC id
in the per-supernode clusters in FILENAME.eg.dot output.
(exploded_graph_annotator::add_node_annotations):
Show the SCC of the supernode in FILENAME.supernode.eg.dot output.
* exploded-graph.h (worklist::scc_id): New.
(exploded_graph::get_scc_id): New.
Prior to this patch the analyzer worklist considered only one node or
two nodes at a time, processing and/or merging state individually or
pairwise.
This could lead to explosions of merger nodes at CFG join points,
especially after switch statements, which could have large numbers
of in-edges, and thus large numbers of merger exploded_nodes could
be created, exceeding the per-point limit and thus stopping analysis
with -Wanalyzer-too-complex.
This patch special-cases the handling for runs of consecutive
nodes in the worklist at a CFG join point, processing and merging
them all together.
The patch fixes a state explosion seen in bzip2.c seen when attempting
to reproduce PR analyzer/95188, in a switch statement in a loop for
argument parsing. With this patch, the analyzer successfully
consolidates the state after the argument parsing to a single exploded
node.
In gcc.dg/analyzer/pr96653.c there is a switch statement with over 300
cases which leads to hitting the per-point limit. With this patch
the consolidation code doesn't manage to merge all of them due to other
worklist-ordering bugs, and it still hits the per-point limits, but it
does manage some very long consolidations:
merged 2 in-enodes into 2 out-enode(s) at SN: 403
merged 2 in-enodes into 2 out-enode(s) at SN: 403
merged 2 in-enodes into 1 out-enode(s) at SN: 11
merged 29 in-enodes into 1 out-enode(s) at SN: 35
merged 6 in-enodes into 1 out-enode(s) at SN: 41
merged 31 in-enodes into 1 out-enode(s) at SN: 35
and with a followup patch to fix an SCC issue it manages:
merged 358 in-enodes into 2 out-enode(s) at SN: 402
The patch appears to fix the failure on non-x86_64 of:
gcc.dg/analyzer/pr93032-mztools.c (test for excess errors)
which is PR analyzer/96616.
Unfortunately, the patch introduces a memory leak false positive in
gcc.dg/analyzer/pr94851-1.c, but this appears to be a pre-existing bug
that was hidden by state-merging failures.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_node::dump_dot): Show STATUS_BULK_MERGED.
(exploded_graph::process_worklist): Call
maybe_process_run_of_before_supernode_enodes.
(exploded_graph::maybe_process_run_of_before_supernode_enodes):
New.
(exploded_graph_annotator::print_enode): Show STATUS_BULK_MERGED.
* exploded-graph.h (enum exploded_node::status): Add
STATUS_BULK_MERGED.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/bzip2-arg-parse-1.c: New test.
* gcc.dg/analyzer/loop-n-down-to-1-by-1.c: Remove xfail.
* gcc.dg/analyzer/pr94851-1.c: Add xfail.
Avoid some future copy-and-paste by introducing a function.
gcc/analyzer/ChangeLog:
* engine.cc
(exploded_graph::process_node) <case PK_BEFORE_SUPERNODE>:
Simplify by using program_point::get_next.
* program-point.cc (program_point::get_next): New.
* program-point.h (program_point::get_next): New decl.
I found this useful when debugging.
gcc/analyzer/ChangeLog:
* engine.cc (exploded_graph::get_or_create_node): Show the
program point when issuing -Wanalyzer-too-complex due to hitting
the per-program-point limit.
Seen whilst debugging another issue, where the analyzer was assuming
conservatively that a call to getchar could clobber a global.
This is handled for most of the other stdio functions by the list
in sm-file.cc
gcc/analyzer/ChangeLog:
* region-model.cc (region_model::on_call_pre): Treat getchar as
having no side-effects.
gcc/testsuite/ChangeLog:
* gcc.dg/analyzer/getchar-1.c: New test.
g++ 4.8.5 rejected cases with SFmode and DFmode, presumably due to
some bug in the constexpr implementation.
for gcc/ChangeLog
* config/rs6000/rs6000.c (have_compare_and_set_mask): Use
E_*mode in cases.
Most uses of rs6000_pcrel_p are called for the current function.
A specialized version for cfun is more efficient for these uses.
2020-09-16 Bill Schmidt <wschmidt@linux.ibm.com>
gcc/
* config/rs6000/predicates.md (current_file_function_operand):
Remove argument from rs6000_pcrel_p call.
* config/rs6000/rs6000-logue.c (rs6000_decl_ok_for_sibcall):
Likewise.
(rs6000_global_entry_point_prologue_needed_p): Likewise.
(rs6000_output_function_prologue): Likewise.
* config/rs6000/rs6000-protos.h (rs6000_function_pcrel_p): New
prototype.
(rs6000_pcrel_p): Remove argument.
* config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Remove
argument from rs6000_pcrel_p call.
(rs6000_call_template_1): Likewise.
(rs6000_indirect_call_template_1): Likewise.
(rs6000_longcall_ref): Likewise.
(rs6000_call_aix): Likewise.
(rs6000_sibcall_aix): Likewise.
(rs6000_function_pcrel_p): Rename from rs6000_pcrel_p.
(rs6000_pcrel_p): Rewrite.
* config/rs6000/rs6000.md (*pltseq_plt_pcrel<mode>): Remove
argument from rs6000_pcrel_p call.
(*call_local<mode>): Likewise.
(*call_value_local<mode>): Likewise.
(*call_nonlocal_aix<mode>): Likewise.
(*call_value_nonlocal_aix<mode>): Likewise.
(*call_indirect_pcrel<mode>): Likewise.
(*call_value_indirect_pcrel<mode>): Likewise.
Here we ICE in char_span::subspan because the offset it gets is -1.
It's -1 because get_substring_ranges_for_loc gets a location whose
column was 0. That only happens in testcases like the attached where
we're dealing with extremely long lines (at least 4065 chars it seems).
This does happen in practice, though, so it's not just a theoretical
problem (e.g. when building the SU2 suite).
Fixed by checking that the column get_substring_ranges_for_loc gets is
sane, akin to other checks in that function.
gcc/ChangeLog:
PR preprocessor/96935
* input.c (get_substring_ranges_for_loc): Return if start.column
is less than 1.
gcc/testsuite/ChangeLog:
PR preprocessor/96935
* gcc.dg/format/pr96935.c: New test.