re PR lto/61868 (-frandom-seed always results in random_seed of 0)
2014-07-31 Bingfeng Mei <bmei@broadcom.com> PR lto/61868 * toplev.c (init_random_seed): Move piece of code never called to set_random_seed. (set_random_seed): see above. * gcc.dg/pr61868.c: New test. From-SVN: r213321
This commit is contained in:
parent
3e455386cf
commit
a793528482
@ -1,3 +1,10 @@
|
||||
2014-07-31 Bingfeng Mei <bmei@broadcom.com>
|
||||
|
||||
PR lto/61868
|
||||
* toplev.c (init_random_seed): Move piece of code never called to
|
||||
set_random_seed.
|
||||
(set_random_seed): see above.
|
||||
|
||||
2014-07-31 Tom de Vries <tom@codesourcery.com>
|
||||
|
||||
* tree-ssa-loop.c (pass_tree_loop_init::execute): Remove dead code.
|
||||
|
@ -1,3 +1,8 @@
|
||||
2014-07-31 Bingfeng Mei <bmei@broadcom.com>
|
||||
|
||||
PR lto/61868
|
||||
* gcc.dg/pr61868.c: New test.
|
||||
|
||||
2014-07-30 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/57397
|
||||
|
9
gcc/testsuite/gcc.dg/pr61868.c
Normal file
9
gcc/testsuite/gcc.dg/pr61868.c
Normal file
@ -0,0 +1,9 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-flto -frandom-seed=0x12345" } */
|
||||
extern int foo (int);
|
||||
int main ()
|
||||
{
|
||||
foo (100);
|
||||
return 0;
|
||||
}
|
||||
/* { dg-final { scan-assembler "\.gnu\.lto.*.12345" } } */
|
20
gcc/toplev.c
20
gcc/toplev.c
@ -282,16 +282,7 @@ init_local_tick (void)
|
||||
static void
|
||||
init_random_seed (void)
|
||||
{
|
||||
if (flag_random_seed)
|
||||
{
|
||||
char *endp;
|
||||
|
||||
/* When the driver passed in a hex number don't crc it again */
|
||||
random_seed = strtoul (flag_random_seed, &endp, 0);
|
||||
if (!(endp > flag_random_seed && *endp == 0))
|
||||
random_seed = crc32_string (0, flag_random_seed);
|
||||
}
|
||||
else if (!random_seed)
|
||||
if (!random_seed)
|
||||
random_seed = local_tick ^ getpid (); /* Old racey fallback method */
|
||||
}
|
||||
|
||||
@ -314,6 +305,15 @@ set_random_seed (const char *val)
|
||||
{
|
||||
const char *old = flag_random_seed;
|
||||
flag_random_seed = val;
|
||||
if (flag_random_seed)
|
||||
{
|
||||
char *endp;
|
||||
|
||||
/* When the driver passed in a hex number don't crc it again */
|
||||
random_seed = strtoul (flag_random_seed, &endp, 0);
|
||||
if (!(endp > flag_random_seed && *endp == 0))
|
||||
random_seed = crc32_string (0, flag_random_seed);
|
||||
}
|
||||
return old;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user