Bug 64878 - [5 Regression] Miscompilation of nntpgrab
Summary: [5 Regression] Miscompilation of nntpgrab
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 5.0
: P1 normal
Target Milestone: 5.0
Assignee: Sebastian Pop
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2015-01-30 17:28 UTC by Jakub Jelinek
Modified: 2016-04-08 17:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-01-30 00:00:00


Attachments
fix (3.00 KB, patch)
2015-02-04 17:30 UTC, Sebastian Pop
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelinek 2015-01-30 17:28:49 UTC
Starting with r218451 gcc miscompiles at -O2 on x86_64-linux (both -m64 and -m32) following testcase:

struct A { int a1; };
struct B { char *b1; int b2; int b3; };
struct C { char *c1; int c2; struct B *c3; };
extern struct A *f1 (char *s);
static struct A *f2 (struct C *x);
__attribute__ ((noinline, noclone)) int f3 (struct A *x, struct A *z) { asm volatile ("" : : "g" (x), "g" (z) : "memory"); return 0; }
__attribute__ ((noinline, noclone)) void f4 (struct A *x, char *y, struct A *z) { asm volatile ("" : : "g" (x), "g" (z), "g" (y) : "memory"); }
__attribute__ ((noinline, noclone)) struct B *f5 (void) { static char b[32]; static struct B f3 = { b, 0, 32 }; return &f3; }
__attribute__ ((noinline, noclone)) int f6 (struct B *p, char *w, int z) { asm volatile ("" : : "g" (p), "g" (w), "g" (z) : "memory"); return 0; }
__attribute__ ((noinline, noclone)) void f7 (struct B *p) { asm volatile ("" : : "g" (p) : "memory"); }
__attribute__ ((noinline, noclone)) void f8 (struct B *p) { asm volatile ("" : : "g" (p) : "memory"); }
__attribute__ ((noinline, noclone)) void f9 (struct A *x) { asm volatile ("" : : "g" (x) : "memory"); }
__attribute__ ((noinline, noclone)) struct A *f10 (void) { static struct A j; asm volatile ("" : :  : "memory"); return &j; }
__attribute__ ((noinline, noclone)) struct A *f11 (void) { static struct A j; asm volatile ("" : :  : "memory"); return &j; }
__attribute__ ((noinline, noclone)) struct A *f12 (int b) { static struct A j; asm volatile ("" : : "g" (b) : "memory"); return &j; }
__attribute__ ((noinline, noclone)) struct A *f13 (int i) { static struct A j; asm volatile ("" : : "g" (i) : "memory"); return &j; }
__attribute__ ((noinline, noclone)) struct A *f14 (double d) { static struct A j; asm volatile ("" : : "g" (&d) : "memory"); return &j; }
__attribute__ ((noinline, noclone)) struct A *f15 (char *s) { static struct A j; asm volatile ("" : : "g" (s) : "memory"); return &j; }
char *t = "0123456789abcdef";
char *u = "0123456789.+-e";

__attribute__ ((noinline, noclone)) struct A *
f1 (char *s)
{
  struct C f;
  struct A *o;
  f.c1 = s;
  f.c2 = 0;
  f.c3 = f5 ();
  o = f2 (&f);
  f8 (f.c3);
  return o;
}

static struct A *
f2 (struct C *x)
{
  int a, b, e = 0;
  struct A *f = 0, *o;
  char *g = 0;
  char h = '\0';
  int i = 0, j = 0;
  a = 0;
  b = 1;
  char c;
  do
    {
      c = x->c1[x->c2];
      switch (a)
	{
	case 0:
	  if (c == ' ')
	    x->c2++;
	  else if (c == '/')
	    {
	      a = 4;
	      j = x->c2++;
	    }
	  else
	    a = b;
	  break;
	case 1:
	  switch (c)
	    {
	    case '{':
	      a = 0;
	      b = 15;
	      f = f10 ();
	      x->c2++;
	      break;
	    case '[':
	      a = 0;
	      b = 13;
	      f = f11 ();
	      x->c2++;
	      break;
	    case 'N':
	    case 'n':
	      a = 3;
	      j = x->c2++;
	      break;
	    case '"':
	    case '\'':
	      h = c;
	      f7 (x->c3);
	      a = 8;
	      j = ++x->c2;
	      break;
	    case 'T':
	    case 't':
	    case 'F':
	    case 'f':
	      a = 11;
	      j = x->c2++;
	      break;
	    case '0' ... '9':
	    case '-':
	      i = 0;
	      a = 12;
	      j = x->c2++;
	      break;
	    default:
	      e = 1;
	      goto out;
	    }
	  break;
	case 2:
	  goto out;
	case 3:
	  if (__builtin_strncmp ("null", x->c1 + j, x->c2 - j))
	    {
	      e = 2;
	      goto out;
	    }
	  if (x->c2 - j == 4)
	    {
	      f = 0;
	      b = 2;
	      a = 0;
	    }
	  else
	    x->c2++;
	  break;
	case 4:
	  if (c == '*')
	    a = 5;
	  else if (c == '/')
	    a = 6;
	  else
	    {
	      e = 8;
	      goto out;
	    }
	  x->c2++;
	  break;
	case 5:
	  if (c == '*')
	    a = 7;
	  x->c2++;
	  break;
	case 6:
	  if (c == '\n')
	    a = 0;
	  x->c2++;
	  break;
	case 7:
	  if (c == '/')
	    a = 0;
	  else
	    a = 5;
	  x->c2++;
	  break;
	case 8:
	  if (c == h)
	    {
	      f6 (x->c3, x->c1 + j, x->c2 - j);
	      f = f15 (x->c3->b1);
	      b = 2;
	      a = 0;
	    }
	  else if (c == '\\')
	    {
	      b = 8;
	      a = 9;
	    }
	  x->c2++;
	  break;
	case 9:
	  switch (c)
	    {
	    case '"':
	    case '\\':
	      f6 (x->c3, x->c1 + j, x->c2 - j - 1);
	      j = x->c2++;
	      a = b;
	      break;
	    case 'b':
	    case 'n':
	    case 'r':
	    case 't':
	      f6 (x->c3, x->c1 + j, x->c2 - j - 1);
	      if (c == 'b')
		f6 (x->c3, "\b", 1);
	      else if (c == 'n')
		f6 (x->c3, "\n", 1);
	      else if (c == 'r')
		f6 (x->c3, "\r", 1);
	      else if (c == 't')
		f6 (x->c3, "\t", 1);
	      j = ++x->c2;
	      a = b;
	      break;
	    case 'u':
	      f6 (x->c3, x->c1 + j, x->c2 - j - 1);
	      j = ++x->c2;
	      a = 10;
	      break;
	    default:
	      e = 7;
	      goto out;
	    }
	  break;
	case 10:
	  if (__builtin_strchr (t, c))
	    {
	      x->c2++;
	      if (x->c2 - j == 4)
		{
		  unsigned char w[3];
		  unsigned int s =
		    (((x->c1[j] <= '9') ? x->c1[j] - '0' : (x->c1[j] & 7) + 9) << 12)
		    + (((x->c1[j + 1] <= '9') ? x->c1[j + 1] - '0' : (x->c1[j + 1] & 7) + 9) << 8)
		    + (((x->c1[j + 2] <= '9') ? x->c1[j + 2] - '0' : (x->c1[j + 2] & 7) + 9) << 4)
		    + ((x->c1[j + 3] <= '9') ? x->c1[j + 3] - '0' : (x->c1[j + 3] & 7) + 9);
		  if (s < 0x80)
		    {
		      w[0] = s;
		      f6 (x->c3, (char *) w, 1);
		    }
		  else if (s < 0x800)
		    {
		      w[0] = 0xc0 | (s >> 6);
		      w[1] = 0x80 | (s & 0x3f);
		      f6 (x->c3, (char *) w, 2);
		    }
		  else
		    {
		      w[0] = 0x0 | (s >> 12);
		      w[1] = 0x80 | ((s >> 6) & 0x3f);
		      w[2] = 0x80 | (s & 0x3f);
		      f6 (x->c3, (char *) w, 3);
		    }
		  j = x->c2;
		  a = b;
		}
	    }
	  else
	    {
	      e = 7;
	      goto out;
	    }
	  break;
	case 11:
	  if (__builtin_strncmp ("true", x->c1 + j, x->c2 - j) == 0)
	    {
	      if (x->c2 - j == 4)
		{
		  f = f12 (1);
		  b = 2;
		  a = 0;
		}
	      else
		x->c2++;
	    }
	  else if (__builtin_strncmp ("false", x->c1 + j, x->c2 - j) == 0)
	    {
	      if (x->c2 - j == 5)
		{
		  f = f12 (0);
		  b = 2;
		  a = 0;
		}
	      else
		x->c2++;
	    }
	  else
	    {
	      e = 3;
	      goto out;
	    }
	  break;
	case 12:
	  if (!c || !__builtin_strchr (u, c))
	    {
	      if (!i)
		f = f13 (0);
	      else
		f = f14 (0.0);
	      b = 2;
	      a = 0;
	    }
	  else
	    {
	      if (c == '.' || c == 'e')
		i = 1;
	      x->c2++;
	    }
	  break;
	case 13:
	  if (c == ']')
	    {
	      x->c2++;
	      b = 2;
	      a = 0;
	    }
	  else
	    {
	      o = f2 (x);
	      if (((unsigned long) o > (unsigned long) -4000L))
		{
		  e = 5;
		  goto out;
		}
	      f3 (f, o);
	      b = 14;
	      a = 0;
	    }
	  break;
	case 14:
	  if (c == ']')
	    {
	      x->c2++;
	      b = 2;
	      a = 0;
	    }
	  else if (c == ',')
	    {
	      x->c2++;
	      b = 13;
	      a = 0;
	    }
	  else
	    {
	      f9 (f);
	      e = 5;
	      goto out;
	    }
	  break;
	case 15:
	  a = 16;
	  j = x->c2;
	  break;
	case 16:
	  if (c == '}')
	    {
	      x->c2++;
	      b = 2;
	      a = 0;
	    }
	  else if (c == '"' || c == '\'')
	    {
	      h = c;
	      f7 (x->c3);
	      a = 17;
	      j = ++x->c2;
	    }
	  else
	    {
	      e = 6;
	      goto out;
	    }
	  break;
	case 17:
	  if (c == h)
	    {
	      f6 (x->c3, x->c1 + j, x->c2 - j);
	      g = __builtin_strdup (x->c3->b1);
	      b = 18;
	      a = 0;
	    }
	  else if (c == '\\')
	    {
	      b = 17;
	      a = 9;
	    }
	  x->c2++;
	  break;
	case 18:
	  if (c == ':')
	    {
	      x->c2++;
	      b = 19;
	      a = 0;
	    }
	  else
	    {
	      e = -6;
	      goto out;
	    }
	  break;
	case 19:
	  o = f2 (x);
	  if (((unsigned long) o > (unsigned long) -4000L))
	    {
	      e = 6;
	      goto out;
	    }
	  f4 (f, g, o);
	  __builtin_free (g);
	  g = 0;
	  b = 20;
	  a = 0;
	  break;
	case 20:
	  if (c == '}')
	    {
	      x->c2++;
	      b = 2;
	      a = 0;
	    }
	  else if (c == ',')
	    {
	      x->c2++;
	      b = 15;
	      a = 0;
	    }
	  else
	    {
	      e = 6;
	      goto out;
	    }
	  break;
	}
    }
  while (c);
  if (a != 2 && b != 2)
    e = 9;
out:
  __builtin_free (g);
  if (e == 0)
    return f;
  f9 (f);
  return 0;
}

int
main ()
{
  asm volatile ("" : : : "memory");
  struct A *r = f1 ("{ \"id\": null, \"blahah\": \"foobarbazbar\", \"barbar\": { \"barbarbarba\":"
		    "\"abcdefgh\", \"ijklmnopqr\": \"stuvwxyzabcdefghijklmnopqrstuv\", \"xyzxyz\":"
		    " [ \"1\" ] } }");
  if (!r)
    __builtin_abort ();
  return 0;
}
Comment 1 Sebastian Pop 2015-01-30 20:15:12 UTC
It fails with -O2 --param max-fsm-thread-paths=10 and does not fail with 9.
This is the thread that generates wrong code:
 Registering FSM jump thread: (102, 6) incoming edge;  (5, 128) nocopy;
Comment 2 Sebastian Pop 2015-01-30 20:19:43 UTC
Jump threading is called twice as two separate passes, the "miscompiled" jump thread during the first invocation is:
 Registering FSM jump thread: (10, 114) incoming edge;  (4, 93) nocopy;

The "miscompiled" jump thread for the second invocation of dom is:

 Registering FSM jump thread: (102, 6) incoming edge;  (5, 128) nocopy;
Comment 3 Sebastian Pop 2015-01-30 20:27:19 UTC
-fdbg-cnt=registered_jump_thread:44 passes
-fdbg-cnt=registered_jump_thread:45 fails

So this is the jump thread that produces the wrong code:
 Registering FSM jump thread: (10, 114) incoming edge;  (4, 93) nocopy
Comment 4 Sebastian Pop 2015-02-02 17:25:42 UTC
The problem is in the recursion step of fsm_find_control_statement_thread_paths:


  for (i = 0; i < gimple_phi_num_args (phi); i++)
    {
      tree arg = gimple_phi_arg_def (phi, i);
      basic_block bbi = gimple_phi_arg_edge (phi, i)->src;
[...]
      if (TREE_CODE (arg) == SSA_NAME)
	{
	  vec_safe_push (path, bbi);
	  /* Recursively follow SSA_NAMEs looking for a constant definition.  */
	  fsm_find_control_statement_thread_paths (arg, visited_phis, path);
	  path->pop ();
	  continue;
	}

We are not supposed to register a jump-thread following only one of the PHI arguments, as the other arguments may resolve into a non-constant or a different constant.

In the current case, we have 

      c = x->c1[x->c2];
      switch (a)
	{
	case 0:
	  if (c == ' ')
	    x->c2++;
	  else if (c == '/')
	    {
	      a = 4;   // here is the first argument of the phi node
	      j = x->c2++;
	    }
	  else
	    a = b;    // recursive call will follow b and resolve into 15

         // here the phi node looks like
         // a0 = phi (4, b)

	  break;
	case 1:
	  switch (c)
	    {
	    case '{':
	      a = 0;
	      b = 15;
	      f = f10 ();
	      x->c2++;
	      break;
Comment 5 Sebastian Pop 2015-02-04 17:30:22 UTC
Created attachment 34665 [details]
fix

The problem is that we jump thread twice across the loop latch:
first, from

	    case '{':
	      a = 0;
	      b = 15;
	      f = f10 ();
	      x->c2++;
	      break;
through the loop latch to: 

	case 0:
	  if (c == ' ')
	    x->c2++;
	  else if (c == '/')
	    {
	      a = 4;
	      j = x->c2++;
	    }
	  else
	    a = b;

and second, from "a = b;" again across the loop latch to case 15.
Attached patch fixes the wrong code and passes make check.
Comment 6 Jakub Jelinek 2015-02-04 17:41:47 UTC
(In reply to Sebastian Pop from comment #5)
> Created attachment 34665 [details]
> fix

Thanks for working on this.  s/accross/across/.  Please mail it to gcc-patches once you test it.
Comment 7 Sebastian Pop 2015-02-06 21:08:45 UTC
Author: spop
Date: Fri Feb  6 21:08:13 2015
New Revision: 220491

URL: https://gcc.gnu.org/viewcvs?rev=220491&root=gcc&view=rev
Log:
PR 64878: do not jump thread across more than one back-edge

2015-02-04  Sebastian Pop  <s.pop@samsung.com>
	    Brian Rzycki  <b.rzycki@samsung.com>

	PR tree-optimization/64878
	* tree-ssa-threadedge.c: Include tree-ssa-loop.h.
	(fsm_find_control_statement_thread_paths): Add parameter seen_loop_phi.
	Stop recursion at loop phi nodes after having visited a loop phi node.

	* testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-threadedge.c
Comment 8 Jakub Jelinek 2015-02-06 21:16:21 UTC
Fixed, thanks.
Comment 9 Yvan Roux 2015-03-05 14:28:37 UTC
Author: yroux
Date: Thu Mar  5 14:28:05 2015
New Revision: 221216

URL: https://gcc.gnu.org/viewcvs?rev=221216&root=gcc&view=rev
Log:
gcc/
2015-03-05  Yvan Roux  <yvan.roux@linaro.org>

	Backport from trunk r212011, r214942, r214957, r215012, r215016, r218115,
	r218733, r218746, r220491.
	2015-02-06  Sebastian Pop  <s.pop@samsung.com>
		    Brian Rzycki  <b.rzycki@samsung.com>

	PR tree-optimization/64878
	* tree-ssa-threadedge.c: Include tree-ssa-loop.h.
	(fsm_find_control_statement_thread_paths): Add parameter seen_loop_phi.
	Stop recursion at loop phi nodes after having visited a loop phi node.

	2014-12-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/64246
	* cfgloop.c (mark_loop_for_removal): Make safe against multiple
	invocations on the same loop.

	2014-12-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/64284
	* tree-ssa-threadupdate.c (duplicate_seme_region): Mark
	the loop for removal if we copied the loop header.

	2014-11-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/64083
	* tree-ssa-threadupdate.c (thread_through_all_blocks): Do not
	forcibly mark loop for removal the wrong way.

	2014-09-08  Richard Biener  <rguenther@suse.de>

	PR ipa/63196
	* tree-inline.c (copy_loops): The source loop header should
	always be non-NULL.
	(tree_function_versioning): If loops need fixup after removing
	unreachable blocks fix them.
	* omp-low.c (simd_clone_adjust): Do not add incr block to
	loop under construction.

	2014-09-08  Richard Biener  <rguenther@suse.de>

	PR bootstrap/63204
	* cfgloop.c (mark_loop_for_removal): Track former header
	unconditionally.
	* cfgloop.h (struct loop): Add former_header member unconditionally.
	* loop-init.c (fix_loop_structure): Enable bogus loop removal
	diagnostic unconditionally.

	2014-09-05  Richard Biener  <rguenther@suse.de>

	* cfgloop.c (mark_loop_for_removal): Record former header
	when ENABLE_CHECKING.
	* cfgloop.h (strut loop): Add former_header member when
	ENABLE_CHECKING.
	* loop-init.c (fix_loop_structure): Sanity check loops
	marked for removal if they re-appeared.

	2014-09-05  Richard Biener  <rguenther@suse.de>

	* cfgloop.c (mark_loop_for_removal): New function.
	* cfgloop.h (mark_loop_for_removal): Declare.
	* cfghooks.c (delete_basic_block): Use mark_loop_for_removal.
	(merge_blocks): Likewise.
	(duplicate_block): Likewise.
	* except.c (sjlj_emit_dispatch_table): Likewise.
	* tree-eh.c (cleanup_empty_eh_merge_phis): Likewise.
	* tree-ssa-threadupdate.c (ssa_redirect_edges): Likewise.
	(thread_through_loop_header): Likewise.

	2014-06-26  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/61607
	* tree-ssa-threadupdate.c (ssa_redirect_edges): Cancel the
	loop if we redirected its latch edge.
	(thread_block_1): Do not cancel loops prematurely.

gcc/testsuite/
2015-03-05  Yvan Roux  <yvan.roux@linaro.org>

	Backport from trunk r218115, r218733, r218746, r220491.
	2015-02-06  Sebastian Pop  <s.pop@samsung.com>
		    Brian Rzycki  <b.rzycki@samsung.com>

	PR tree-optimization/64878
	* testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c: New.

	2014-12-15  Richard Biener  <rguenther@suse.de>

	PR middle-end/64246
	* gnat.dg/opt46.adb: New testcase.
	* gnat.dg/opt46.ads: Likewise.
	* gnat.dg/opt46_pkg.adb: Likewise.
	* gnat.dg/opt46_pkg.ads: Likewise.

	2014-12-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/64284
	* gcc.dg/torture/pr64284.c: New testcase.

	2014-11-27  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/64083
	* gcc.dg/torture/pr64083.c: New testcase.


Added:
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr64083.c
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr64284.c
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-8.c
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46.adb
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46.ads
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46_pkg.adb
    branches/linaro/gcc-4_9-branch/gcc/testsuite/gnat.dg/opt46_pkg.ads
Modified:
    branches/linaro/gcc-4_9-branch/gcc/ChangeLog.linaro
    branches/linaro/gcc-4_9-branch/gcc/cfghooks.c
    branches/linaro/gcc-4_9-branch/gcc/cfgloop.c
    branches/linaro/gcc-4_9-branch/gcc/cfgloop.h
    branches/linaro/gcc-4_9-branch/gcc/except.c
    branches/linaro/gcc-4_9-branch/gcc/loop-init.c
    branches/linaro/gcc-4_9-branch/gcc/omp-low.c
    branches/linaro/gcc-4_9-branch/gcc/testsuite/ChangeLog.linaro
    branches/linaro/gcc-4_9-branch/gcc/tree-eh.c
    branches/linaro/gcc-4_9-branch/gcc/tree-inline.c
    branches/linaro/gcc-4_9-branch/gcc/tree-ssa-threadedge.c
    branches/linaro/gcc-4_9-branch/gcc/tree-ssa-threadupdate.c
Comment 10 ctice 2016-04-08 17:09:42 UTC
Author: ctice
Date: Fri Apr  8 17:09:09 2016
New Revision: 234832

URL: https://gcc.gnu.org/viewcvs?rev=234832&root=gcc&view=rev
Log:
Unify changes with Android's GCC 4.9 compiler.

Add the following changes from the Android
GCC 4.9 compiler (mostly adding fixes for aarch64):

Fix mingw build breakage
    1) Add missing _GCOV_fopen if !__KERNEL__
    2) Use _fullpath

Backport Cortex-A57's machine description support from trunk

Adjust generic move costs for aarch64. Backport from trunk

Enable C++ exceptions and RTTI by default.

Modify LINK_SPEC to pass --fix-cortex-a53-843419 as default

Rename libstdc++.so to libgnustl_shared.so when enabling bionic libs.

Drop mips64r2 from Android compiler's multilib

Merge "Drop mips64r2 from Android compiler's multilib"

Adjust several costs for AArch64:
  Refactor aarch64_address_costs; add cost tables for Cortex-A7;
  better estimate cost of building a constant; wrap aarch64_rtx_costs
  to dump verbose output; factor out common MULT cases; det default
  costs and handle vector modes; cost memory accesses using address
  costs; better cost logical operations; improve costs for div/mod and
  sign/zero extend operations; cost comparisons, flag setting
  operators and IF_THEN_ELSE; cost more Floating point RTX; cost
  TRUNCATE, SET, SYMBOL_REF, HIGH and LO_SUM; dump a message if we are
  unable to cost an insn; fix typos in cost data structure.


Add several improvements for AArch64 (Backported from GCC 5):
  (spill code - swap order in shr patterns; spill code - swap order in
  shl pattern; fix aarch64_rtx_costs of PLUS/MINUS; cost operand 0 in
  FP compare-with-0.0 case; properly cost FABD pattern; properly
  handle mvn-register and add EON+shift pattern and cost
  appropriately).

Disable inlining of memcpy for x86 with 'rep movs'.
Default to TLS guard for x86 stack-protector.
Change gcc BASE-VER from 4.9.x-google to 4.9.x

Cherry pick the following fixes from trunk: PR bootstrap/66638, 67954
(svn rev 230894, PR tree-optimization/65447,
PR tree-optimization/52563, tree-optimization/62173,
PR tree-optimization/48052, PR 64878, PR65048, PR65177, PR65735.

Port revision 219584 from linaro/gcc-4_9-branch

Fix for arm64 bad code for copysignl.


Added:
    branches/google/gcc-4_9-mobile/gcc/sancov.c
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/sancov/
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/sancov/asan.c
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/sancov/basic0.c
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/sancov/basic1.c
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/sancov/basic2.c
Modified:
    branches/google/gcc-4_9-mobile/ChangeLog
    branches/google/gcc-4_9-mobile/config/futex.m4
    branches/google/gcc-4_9-mobile/configure
    branches/google/gcc-4_9-mobile/configure.ac
    branches/google/gcc-4_9-mobile/gcc/BASE-VER
    branches/google/gcc-4_9-mobile/gcc/ChangeLog
    branches/google/gcc-4_9-mobile/gcc/Makefile.in
    branches/google/gcc-4_9-mobile/gcc/builtins.def
    branches/google/gcc-4_9-mobile/gcc/cfghooks.c
    branches/google/gcc-4_9-mobile/gcc/cfgloop.c
    branches/google/gcc-4_9-mobile/gcc/cfgloop.h
    branches/google/gcc-4_9-mobile/gcc/common.opt
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64-cores.def
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64-elf-raw.h
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64-linux.h
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64-protos.h
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64-tune.md
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64.c
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64.md
    branches/google/gcc-4_9-mobile/gcc/config/aarch64/aarch64.opt
    branches/google/gcc-4_9-mobile/gcc/config/i386/i386.c
    branches/google/gcc-4_9-mobile/gcc/config/linux-android.h
    branches/google/gcc-4_9-mobile/gcc/config/mips/t-linux-android64
    branches/google/gcc-4_9-mobile/gcc/configure
    branches/google/gcc-4_9-mobile/gcc/doc/invoke.texi
    branches/google/gcc-4_9-mobile/gcc/except.c
    branches/google/gcc-4_9-mobile/gcc/expmed.c
    branches/google/gcc-4_9-mobile/gcc/gcov-io.h
    branches/google/gcc-4_9-mobile/gcc/loop-init.c
    branches/google/gcc-4_9-mobile/gcc/lra-constraints.c
    branches/google/gcc-4_9-mobile/gcc/omp-low.c
    branches/google/gcc-4_9-mobile/gcc/params.def
    branches/google/gcc-4_9-mobile/gcc/passes.def
    branches/google/gcc-4_9-mobile/gcc/sanitizer.def
    branches/google/gcc-4_9-mobile/gcc/testsuite/ChangeLog
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/tree-ssa/scev-3.c
    branches/google/gcc-4_9-mobile/gcc/testsuite/gcc.dg/tree-ssa/scev-4.c
    branches/google/gcc-4_9-mobile/gcc/tree-cfg.c
    branches/google/gcc-4_9-mobile/gcc/tree-cfg.h
    branches/google/gcc-4_9-mobile/gcc/tree-chrec.c
    branches/google/gcc-4_9-mobile/gcc/tree-chrec.h
    branches/google/gcc-4_9-mobile/gcc/tree-pass.h
    branches/google/gcc-4_9-mobile/gcc/tree-scalar-evolution.c
    branches/google/gcc-4_9-mobile/gcc/tree-scalar-evolution.h
    branches/google/gcc-4_9-mobile/gcc/tree-ssa-loop-ivopts.c
    branches/google/gcc-4_9-mobile/gcc/tree-ssa-loop-niter.c
    branches/google/gcc-4_9-mobile/gcc/tree-ssa-loop-niter.h
    branches/google/gcc-4_9-mobile/gcc/tree-ssa-threadedge.c
    branches/google/gcc-4_9-mobile/gcc/tree-ssa-threadupdate.c
    branches/google/gcc-4_9-mobile/gcc/tree-ssa-threadupdate.h
    branches/google/gcc-4_9-mobile/libgcc/libgcov-util.c
    branches/google/gcc-4_9-mobile/libstdc++-v3/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/acinclude.m4
    branches/google/gcc-4_9-mobile/libstdc++-v3/configure
    branches/google/gcc-4_9-mobile/libstdc++-v3/configure.ac
    branches/google/gcc-4_9-mobile/libstdc++-v3/doc/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/include/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/libsupc++/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/po/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/python/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/src/Makefile.am
    branches/google/gcc-4_9-mobile/libstdc++-v3/src/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/src/c++11/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/src/c++98/Makefile.in
    branches/google/gcc-4_9-mobile/libstdc++-v3/testsuite/Makefile.in