diff mbox

[i386] Fix SEGV in ix86_in_large_data_p (PR target/71080)

Message ID yddy47euyvj.fsf@CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 13, 2016, 8:48 a.m. UTC
When running the full testsuite with -mcmodel=medium, several tests FAIL
with a NULL pointer dereference as described in the PR.

Since these calls ultimately originate from get_named_section(NULL_TREE,
...) calls, the obvious fix seems the right thing to do.

Bootstrapped without regressions on x86_64-pc-linux-gnu, followed by an
additional testsuite run with -mcmodel=medium.  The only changes present
are those reported in PR target/71097, and I've verified that they also
exist on the gcc-6 branch, i.e. without my patch.

Ok for mainline?

	Rainer


2016-05-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR target/71080
	* config/i386/i386.c (ix86_in_large_data_p): Guard against NULL exp.

Comments

Uros Bizjak May 13, 2016, 8:53 a.m. UTC | #1
On Fri, May 13, 2016 at 10:48 AM, Rainer Orth
<ro@cebitec.uni-bielefeld.de> wrote:
> When running the full testsuite with -mcmodel=medium, several tests FAIL
> with a NULL pointer dereference as described in the PR.
>
> Since these calls ultimately originate from get_named_section(NULL_TREE,
> ...) calls, the obvious fix seems the right thing to do.
>
> Bootstrapped without regressions on x86_64-pc-linux-gnu, followed by an
> additional testsuite run with -mcmodel=medium.  The only changes present
> are those reported in PR target/71097, and I've verified that they also
> exist on the gcc-6 branch, i.e. without my patch.
>
> Ok for mainline?
>
>         Rainer
>
>
> 2016-05-12  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
>
>         PR target/71080
>         * config/i386/i386.c (ix86_in_large_data_p): Guard against NULL exp.

OK.

Thanks,
Uros.
diff mbox

Patch

# HG changeset patch
# Parent  df465f483742f325ab7a60c2058cd31681949212
Fix SEGV in ix86_in_large_data_p (PR target/71080)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6823,6 +6823,9 @@  ix86_in_large_data_p (tree exp)
   if (ix86_cmodel != CM_MEDIUM && ix86_cmodel != CM_MEDIUM_PIC)
     return false;
 
+  if (exp == NULL_TREE)
+    return false;
+
   /* Functions are never large data.  */
   if (TREE_CODE (exp) == FUNCTION_DECL)
     return false;