Bug 54614 - Vector * Matrix -> Vector gives wrong result
Summary: Vector * Matrix -> Vector gives wrong result
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.6.4
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-18 10:40 UTC by simon
Modified: 2012-12-16 10:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-09-18 00:00:00


Attachments
Reproducer (290 bytes, application/octet-stream)
2012-09-18 10:40 UTC, simon
Details
Proposed patch for 4.7.0 code (192 bytes, patch)
2012-09-18 10:44 UTC, simon
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description simon 2012-09-18 10:40:44 UTC
Created attachment 28212 [details]
Reproducer

At GCC 4.7.0 (and in SVN r191415) System.Generic_Array_Operations.Vector_Matrix_Product returns the wrong result.

The attached code should output

** V*M :   3010.0  4020.0

but in fact outputs

** V*M :     40.0  6000.0

I've also attached a patch for GCC 4.7.0.
Comment 1 simon 2012-09-18 10:44:47 UTC
Created attachment 28213 [details]
Proposed patch for 4.7.0 code
Comment 2 Eric Botcazou 2012-09-18 21:38:41 UTC
Thanks for the report and the patch.
Comment 3 Eric Botcazou 2012-12-16 10:40:36 UTC
Author: ebotcazou
Date: Sun Dec 16 10:40:32 2012
New Revision: 194534

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194534
Log:
	PR ada/54614
	Backport from mainline

	2012-10-01  Vincent Pucci  <pucci@adacore.com>

	* s-gearop.adb (Vector_Matrix_Product): Fix dimension check and index
	of Left in S evaluation.

Modified:
    branches/gcc-4_7-branch/gcc/ada/ChangeLog
    branches/gcc-4_7-branch/gcc/ada/s-gearop.adb
Comment 4 Eric Botcazou 2012-12-16 10:45:16 UTC
Author: ebotcazou
Date: Sun Dec 16 10:45:12 2012
New Revision: 194535

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194535
Log:
	PR ada/54614
	Backport from mainline

	2012-10-01  Vincent Pucci  <pucci@adacore.com>

	* s-gearop.adb (Vector_Matrix_Product): Fix dimension check and index
	of Left in S evaluation.

Modified:
    branches/gcc-4_6-branch/gcc/ada/ChangeLog
    branches/gcc-4_6-branch/gcc/ada/s-gearop.adb
Comment 5 Eric Botcazou 2012-12-16 10:46:41 UTC
Fixed on all active branches.