* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
@ 2014-05-23 15:18 ` dominiq at lps dot ens.fr
2014-05-23 20:48 ` rouson at stanford dot edu
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-05-23 15:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-05-23
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Confirmed. The error disappeared between r201266 (2013-07-26) and r201631
(2013-08-09).
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
2014-05-23 15:18 ` [Bug fortran/61281] " dominiq at lps dot ens.fr
@ 2014-05-23 20:48 ` rouson at stanford dot edu
2014-05-23 21:00 ` dominiq at lps dot ens.fr
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rouson at stanford dot edu @ 2014-05-23 20:48 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
--- Comment #2 from Damian Rouson <rouson at stanford dot edu> ---
I assume you're saying it disappeared and then reappeared and you're confirming
the problem exists on the current trunk. Correct?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
2014-05-23 15:18 ` [Bug fortran/61281] " dominiq at lps dot ens.fr
2014-05-23 20:48 ` rouson at stanford dot edu
@ 2014-05-23 21:00 ` dominiq at lps dot ens.fr
2014-06-01 9:44 ` dominiq at lps dot ens.fr
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-05-23 21:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I assume you're saying it disappeared and then reappeared and you're confirming
> the problem exists on the current trunk. Correct?
Sorry for the confusion. I meant
(1) I confirm the memory corruption after r201631,
(2) at least up to r201266, but not after r201630 (no archive in the gap),
gfortran used to emit the error
Error: Can't convert CLASS(employees) to TYPE(employees) at (1)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
` (2 preceding siblings ...)
2014-05-23 21:00 ` dominiq at lps dot ens.fr
@ 2014-06-01 9:44 ` dominiq at lps dot ens.fr
2014-12-14 9:43 ` janus at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-06-01 9:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org,
| |janus at gcc dot gnu.org
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Valgrind nor -fsanitize=address don't report any error.
The "memory corruption" is not limited to character variable and it occurs
already in map, i.e., give_raise(nrl%list) does not return 'rob'.
The error "Can't convert CLASS(employees) to TYPE(employees) at (1)" may have
been removed by r201328.
The original dump for type is:
map ()
{
nrl.list = give_raise (&nrl.list);
}
give_raise (struct employees & restrict e)
{
struct employees __result_give_raise;
{
struct employees employees.0;
(MEM[(c_char * {ref-all})&employees.0] = MEM[(c_char * {ref-all})"rob"];,
(void *) &employees.0.name;);
__result_give_raise = employees.0;
}
__result_give_raise = *e;
return __result_give_raise;
}
MAIN__ ()
{
static struct companies nrl = {.list={.name="rob"}};
static struct employees give_raise (struct employees & restrict);
static void map (void);
and with class it is:
__copy_MAIN___Employees (struct employees & restrict src, struct employees &
restrict dst)
{
*dst = *src;
}
map ()
{
{
struct __class_MAIN___Employees_t class.0;
class.0._vptr = (struct __vtype_MAIN___Employees * {ref-all})
&__vtab_MAIN___Employees;
class.0._data = &nrl.list;
nrl.list = give_raise (&class.0);
}
}
give_raise (struct __class_MAIN___Employees_t & restrict e)
{
struct employees __result_give_raise;
{
struct employees employees.1;
(MEM[(c_char * {ref-all})&employees.1] = MEM[(c_char * {ref-all})"rob"];,
(void *) &employees.1.name;);
__result_give_raise = employees.1;
}
__result_give_raise = VIEW_CONVERT_EXPR<struct employees>(*e);
return __result_give_raise;
}
MAIN__ ()
{
static struct __vtype_MAIN___Employees __vtab_MAIN___Employees =
{._hash=65382630, ._size=3, ._extends=0B,
._def_init=&__def_init_MAIN___Employees, ._copy=__copy_MAIN___Employees,
._final=0B};
static struct employees __def_init_MAIN___Employees = {.name="rob"};
static struct companies nrl = {.list={.name="rob"}};
static struct employees give_raise (struct __class_MAIN___Employees_t &
restrict);
static void map (void);
static void __copy_MAIN___Employees (struct employees & restrict, struct
employees & restrict);
...
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
` (3 preceding siblings ...)
2014-06-01 9:44 ` dominiq at lps dot ens.fr
@ 2014-12-14 9:43 ` janus at gcc dot gnu.org
2014-12-14 10:24 ` dominiq at lps dot ens.fr
2014-12-14 12:13 ` janus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2014-12-14 9:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
--- Comment #5 from janus at gcc dot gnu.org ---
I can confirm the misbehavior with 4.9.1, but it seems that the problem is gone
on current trunk:
$ ./a.out
rob
rob
gcc version 5.0.0 20141213 (experimental) [trunk revision 218705] (GCC)
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
` (4 preceding siblings ...)
2014-12-14 9:43 ` janus at gcc dot gnu.org
@ 2014-12-14 10:24 ` dominiq at lps dot ens.fr
2014-12-14 12:13 ` janus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-12-14 10:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> I can confirm the misbehavior with 4.9.1, but it seems that the problem
> is gone on current trunk:
Confirmed. Likely fixed by r 216427 (pr63553).
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug fortran/61281] Memory corruption on assigning a polymorphic variable to a non-polymorphic one
2014-05-22 4:11 [Bug fortran/61281] New: Memory corruption on assigning a polymorphic variable to a non-polymorphic one rouson at stanford dot edu
` (5 preceding siblings ...)
2014-12-14 10:24 ` dominiq at lps dot ens.fr
@ 2014-12-14 12:13 ` janus at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: janus at gcc dot gnu.org @ 2014-12-14 12:13 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61281
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|NEW |RESOLVED
Known to work| |5.0
Resolution|--- |FIXED
Known to fail| |4.9.0
--- Comment #7 from janus at gcc dot gnu.org ---
(In reply to Dominique d'Humieres from comment #6)
> Confirmed. Likely fixed by r 216427 (pr63553).
Probably. Closing as fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread