Bug 23906 - inappropriate branch condition in function "transform_sections" in "dependency.c"
Summary: inappropriate branch condition in function "transform_sections" in "dependenc...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-15 22:48 UTC by skyhover
Modified: 2005-09-16 03:27 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-16 03:26:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description skyhover 2005-09-15 22:48:15 UTC
Line 422 in the file is a if-statement:  
  if (l_stride != NULL) 
    mpz_cdiv_q (X2, X2, r_stride->value.integer); 
 
I am not clear about the functionality of "mpz_cdiv_q", but I think the 
condition should be "r_stride != NULL" by looking at its surroundings and 
complying to certain consistency rules.  
 
Thank you.
Comment 1 Paul Brook 2005-09-16 03:26:54 UTC
This looks like a bug. However I don't agree with this analysis.
We should be applying the same transformation to both l and r.
Also, multiplying then dividing by the same value makes no sense.
Comment 2 GCC Commits 2005-09-16 03:26:56 UTC
Subject: Bug 23906

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pbrook@gcc.gnu.org	2005-09-16 03:26:37

Modified files:
	gcc/fortran    : ChangeLog dependency.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gfortran.dg: dependency_1.f90 

Log message:
	2005-09-16  Paul Brook  <paul@codesourcery.com>
	
	PR fortran/23906
	fortran/
	* dependency.c (transform_sections): Divide by correct value.
	Elaborate comment.
	testsuite/
	* gfortran.dg/dependency_1.f90: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.555&r2=1.556
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/dependency.c.diff?cvsroot=gcc&r1=1.9&r2=1.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6069&r2=1.6070
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/dependency_1.f90.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 3 Paul Brook 2005-09-16 03:27:36 UTC
Fixed.