data.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. /* Supporting functions for resolving DATA statement.
  2. Copyright (C) 2002-2015 Free Software Foundation, Inc.
  3. Contributed by Lifang Zeng <zlf605@hotmail.com>
  4. This file is part of GCC.
  5. GCC is free software; you can redistribute it and/or modify it under
  6. the terms of the GNU General Public License as published by the Free
  7. Software Foundation; either version 3, or (at your option) any later
  8. version.
  9. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  12. for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with GCC; see the file COPYING3. If not see
  15. <http://www.gnu.org/licenses/>. */
  16. /* Notes for DATA statement implementation:
  17. We first assign initial value to each symbol by gfc_assign_data_value
  18. during resolving DATA statement. Refer to check_data_variable and
  19. traverse_data_list in resolve.c.
  20. The complexity exists in the handling of array section, implied do
  21. and array of struct appeared in DATA statement.
  22. We call gfc_conv_structure, gfc_con_array_array_initializer,
  23. etc., to convert the initial value. Refer to trans-expr.c and
  24. trans-array.c. */
  25. #include "config.h"
  26. #include "system.h"
  27. #include "coretypes.h"
  28. #include "gfortran.h"
  29. #include "data.h"
  30. #include "constructor.h"
  31. static void formalize_init_expr (gfc_expr *);
  32. /* Calculate the array element offset. */
  33. static void
  34. get_array_index (gfc_array_ref *ar, mpz_t *offset)
  35. {
  36. gfc_expr *e;
  37. int i;
  38. mpz_t delta;
  39. mpz_t tmp;
  40. mpz_init (tmp);
  41. mpz_set_si (*offset, 0);
  42. mpz_init_set_si (delta, 1);
  43. for (i = 0; i < ar->dimen; i++)
  44. {
  45. e = gfc_copy_expr (ar->start[i]);
  46. gfc_simplify_expr (e, 1);
  47. if ((gfc_is_constant_expr (ar->as->lower[i]) == 0)
  48. || (gfc_is_constant_expr (ar->as->upper[i]) == 0)
  49. || (gfc_is_constant_expr (e) == 0))
  50. gfc_error ("non-constant array in DATA statement %L", &ar->where);
  51. mpz_set (tmp, e->value.integer);
  52. gfc_free_expr (e);
  53. mpz_sub (tmp, tmp, ar->as->lower[i]->value.integer);
  54. mpz_mul (tmp, tmp, delta);
  55. mpz_add (*offset, tmp, *offset);
  56. mpz_sub (tmp, ar->as->upper[i]->value.integer,
  57. ar->as->lower[i]->value.integer);
  58. mpz_add_ui (tmp, tmp, 1);
  59. mpz_mul (delta, tmp, delta);
  60. }
  61. mpz_clear (delta);
  62. mpz_clear (tmp);
  63. }
  64. /* Find if there is a constructor which component is equal to COM.
  65. TODO: remove this, use symbol.c(gfc_find_component) instead. */
  66. static gfc_constructor *
  67. find_con_by_component (gfc_component *com, gfc_constructor_base base)
  68. {
  69. gfc_constructor *c;
  70. for (c = gfc_constructor_first (base); c; c = gfc_constructor_next (c))
  71. if (com == c->n.component)
  72. return c;
  73. return NULL;
  74. }
  75. /* Create a character type initialization expression from RVALUE.
  76. TS [and REF] describe [the substring of] the variable being initialized.
  77. INIT is the existing initializer, not NULL. Initialization is performed
  78. according to normal assignment rules. */
  79. static gfc_expr *
  80. create_character_initializer (gfc_expr *init, gfc_typespec *ts,
  81. gfc_ref *ref, gfc_expr *rvalue)
  82. {
  83. int len, start, end;
  84. gfc_char_t *dest;
  85. bool alloced_init = false;
  86. gfc_extract_int (ts->u.cl->length, &len);
  87. if (init == NULL)
  88. {
  89. /* Create a new initializer. */
  90. init = gfc_get_character_expr (ts->kind, NULL, NULL, len);
  91. init->ts = *ts;
  92. alloced_init = true;
  93. }
  94. dest = init->value.character.string;
  95. if (ref)
  96. {
  97. gfc_expr *start_expr, *end_expr;
  98. gcc_assert (ref->type == REF_SUBSTRING);
  99. /* Only set a substring of the destination. Fortran substring bounds
  100. are one-based [start, end], we want zero based [start, end). */
  101. start_expr = gfc_copy_expr (ref->u.ss.start);
  102. end_expr = gfc_copy_expr (ref->u.ss.end);
  103. if ((!gfc_simplify_expr(start_expr, 1))
  104. || !(gfc_simplify_expr(end_expr, 1)))
  105. {
  106. gfc_error ("failure to simplify substring reference in DATA "
  107. "statement at %L", &ref->u.ss.start->where);
  108. gfc_free_expr (start_expr);
  109. gfc_free_expr (end_expr);
  110. if (alloced_init)
  111. gfc_free_expr (init);
  112. return NULL;
  113. }
  114. gfc_extract_int (start_expr, &start);
  115. gfc_free_expr (start_expr);
  116. start--;
  117. gfc_extract_int (end_expr, &end);
  118. gfc_free_expr (end_expr);
  119. }
  120. else
  121. {
  122. /* Set the whole string. */
  123. start = 0;
  124. end = len;
  125. }
  126. /* Copy the initial value. */
  127. if (rvalue->ts.type == BT_HOLLERITH)
  128. len = rvalue->representation.length - rvalue->ts.u.pad;
  129. else
  130. len = rvalue->value.character.length;
  131. if (len > end - start)
  132. {
  133. gfc_warning_now (0, "Initialization string starting at %L was "
  134. "truncated to fit the variable (%d/%d)",
  135. &rvalue->where, end - start, len);
  136. len = end - start;
  137. }
  138. if (rvalue->ts.type == BT_HOLLERITH)
  139. {
  140. int i;
  141. for (i = 0; i < len; i++)
  142. dest[start+i] = rvalue->representation.string[i];
  143. }
  144. else
  145. memcpy (&dest[start], rvalue->value.character.string,
  146. len * sizeof (gfc_char_t));
  147. /* Pad with spaces. Substrings will already be blanked. */
  148. if (len < end - start && ref == NULL)
  149. gfc_wide_memset (&dest[start + len], ' ', end - (start + len));
  150. if (rvalue->ts.type == BT_HOLLERITH)
  151. {
  152. init->representation.length = init->value.character.length;
  153. init->representation.string
  154. = gfc_widechar_to_char (init->value.character.string,
  155. init->value.character.length);
  156. }
  157. return init;
  158. }
  159. /* Assign the initial value RVALUE to LVALUE's symbol->value. If the
  160. LVALUE already has an initialization, we extend this, otherwise we
  161. create a new one. If REPEAT is non-NULL, initialize *REPEAT
  162. consecutive values in LVALUE the same value in RVALUE. In that case,
  163. LVALUE must refer to a full array, not an array section. */
  164. bool
  165. gfc_assign_data_value (gfc_expr *lvalue, gfc_expr *rvalue, mpz_t index,
  166. mpz_t *repeat)
  167. {
  168. gfc_ref *ref;
  169. gfc_expr *init;
  170. gfc_expr *expr = NULL;
  171. gfc_constructor *con;
  172. gfc_constructor *last_con;
  173. gfc_symbol *symbol;
  174. gfc_typespec *last_ts;
  175. mpz_t offset;
  176. symbol = lvalue->symtree->n.sym;
  177. init = symbol->value;
  178. last_ts = &symbol->ts;
  179. last_con = NULL;
  180. mpz_init_set_si (offset, 0);
  181. /* Find/create the parent expressions for subobject references. */
  182. for (ref = lvalue->ref; ref; ref = ref->next)
  183. {
  184. /* Break out of the loop if we find a substring. */
  185. if (ref->type == REF_SUBSTRING)
  186. {
  187. /* A substring should always be the last subobject reference. */
  188. gcc_assert (ref->next == NULL);
  189. break;
  190. }
  191. /* Use the existing initializer expression if it exists. Otherwise
  192. create a new one. */
  193. if (init == NULL)
  194. expr = gfc_get_expr ();
  195. else
  196. expr = init;
  197. /* Find or create this element. */
  198. switch (ref->type)
  199. {
  200. case REF_ARRAY:
  201. if (ref->u.ar.as->rank == 0)
  202. {
  203. gcc_assert (ref->u.ar.as->corank > 0);
  204. if (init == NULL)
  205. free (expr);
  206. continue;
  207. }
  208. if (init && expr->expr_type != EXPR_ARRAY)
  209. {
  210. gfc_error_1 ("'%s' at %L already is initialized at %L",
  211. lvalue->symtree->n.sym->name, &lvalue->where,
  212. &init->where);
  213. goto abort;
  214. }
  215. if (init == NULL)
  216. {
  217. /* The element typespec will be the same as the array
  218. typespec. */
  219. expr->ts = *last_ts;
  220. /* Setup the expression to hold the constructor. */
  221. expr->expr_type = EXPR_ARRAY;
  222. expr->rank = ref->u.ar.as->rank;
  223. }
  224. if (ref->u.ar.type == AR_ELEMENT)
  225. get_array_index (&ref->u.ar, &offset);
  226. else
  227. mpz_set (offset, index);
  228. /* Check the bounds. */
  229. if (mpz_cmp_si (offset, 0) < 0)
  230. {
  231. gfc_error ("Data element below array lower bound at %L",
  232. &lvalue->where);
  233. goto abort;
  234. }
  235. else if (repeat != NULL
  236. && ref->u.ar.type != AR_ELEMENT)
  237. {
  238. mpz_t size, end;
  239. gcc_assert (ref->u.ar.type == AR_FULL
  240. && ref->next == NULL);
  241. mpz_init_set (end, offset);
  242. mpz_add (end, end, *repeat);
  243. if (spec_size (ref->u.ar.as, &size))
  244. {
  245. if (mpz_cmp (end, size) > 0)
  246. {
  247. mpz_clear (size);
  248. gfc_error ("Data element above array upper bound at %L",
  249. &lvalue->where);
  250. goto abort;
  251. }
  252. mpz_clear (size);
  253. }
  254. con = gfc_constructor_lookup (expr->value.constructor,
  255. mpz_get_si (offset));
  256. if (!con)
  257. {
  258. con = gfc_constructor_lookup_next (expr->value.constructor,
  259. mpz_get_si (offset));
  260. if (con != NULL && mpz_cmp (con->offset, end) >= 0)
  261. con = NULL;
  262. }
  263. /* Overwriting an existing initializer is non-standard but
  264. usually only provokes a warning from other compilers. */
  265. if (con != NULL && con->expr != NULL)
  266. {
  267. /* Order in which the expressions arrive here depends on
  268. whether they are from data statements or F95 style
  269. declarations. Therefore, check which is the most
  270. recent. */
  271. gfc_expr *exprd;
  272. exprd = (LOCATION_LINE (con->expr->where.lb->location)
  273. > LOCATION_LINE (rvalue->where.lb->location))
  274. ? con->expr : rvalue;
  275. if (gfc_notify_std (GFC_STD_GNU,
  276. "re-initialization of %qs at %L",
  277. symbol->name, &exprd->where) == false)
  278. return false;
  279. }
  280. while (con != NULL)
  281. {
  282. gfc_constructor *next_con = gfc_constructor_next (con);
  283. if (mpz_cmp (con->offset, end) >= 0)
  284. break;
  285. if (mpz_cmp (con->offset, offset) < 0)
  286. {
  287. gcc_assert (mpz_cmp_si (con->repeat, 1) > 0);
  288. mpz_sub (con->repeat, offset, con->offset);
  289. }
  290. else if (mpz_cmp_si (con->repeat, 1) > 0
  291. && mpz_get_si (con->offset)
  292. + mpz_get_si (con->repeat) > mpz_get_si (end))
  293. {
  294. int endi;
  295. splay_tree_node node
  296. = splay_tree_lookup (con->base,
  297. mpz_get_si (con->offset));
  298. gcc_assert (node
  299. && con == (gfc_constructor *) node->value
  300. && node->key == (splay_tree_key)
  301. mpz_get_si (con->offset));
  302. endi = mpz_get_si (con->offset)
  303. + mpz_get_si (con->repeat);
  304. if (endi > mpz_get_si (end) + 1)
  305. mpz_set_si (con->repeat, endi - mpz_get_si (end));
  306. else
  307. mpz_set_si (con->repeat, 1);
  308. mpz_set (con->offset, end);
  309. node->key = (splay_tree_key) mpz_get_si (end);
  310. break;
  311. }
  312. else
  313. gfc_constructor_remove (con);
  314. con = next_con;
  315. }
  316. con = gfc_constructor_insert_expr (&expr->value.constructor,
  317. NULL, &rvalue->where,
  318. mpz_get_si (offset));
  319. mpz_set (con->repeat, *repeat);
  320. repeat = NULL;
  321. mpz_clear (end);
  322. break;
  323. }
  324. else
  325. {
  326. mpz_t size;
  327. if (spec_size (ref->u.ar.as, &size))
  328. {
  329. if (mpz_cmp (offset, size) >= 0)
  330. {
  331. mpz_clear (size);
  332. gfc_error ("Data element above array upper bound at %L",
  333. &lvalue->where);
  334. goto abort;
  335. }
  336. mpz_clear (size);
  337. }
  338. }
  339. con = gfc_constructor_lookup (expr->value.constructor,
  340. mpz_get_si (offset));
  341. if (!con)
  342. {
  343. con = gfc_constructor_insert_expr (&expr->value.constructor,
  344. NULL, &rvalue->where,
  345. mpz_get_si (offset));
  346. }
  347. else if (mpz_cmp_si (con->repeat, 1) > 0)
  348. {
  349. /* Need to split a range. */
  350. if (mpz_cmp (con->offset, offset) < 0)
  351. {
  352. gfc_constructor *pred_con = con;
  353. con = gfc_constructor_insert_expr (&expr->value.constructor,
  354. NULL, &con->where,
  355. mpz_get_si (offset));
  356. con->expr = gfc_copy_expr (pred_con->expr);
  357. mpz_add (con->repeat, pred_con->offset, pred_con->repeat);
  358. mpz_sub (con->repeat, con->repeat, offset);
  359. mpz_sub (pred_con->repeat, offset, pred_con->offset);
  360. }
  361. if (mpz_cmp_si (con->repeat, 1) > 0)
  362. {
  363. gfc_constructor *succ_con;
  364. succ_con
  365. = gfc_constructor_insert_expr (&expr->value.constructor,
  366. NULL, &con->where,
  367. mpz_get_si (offset) + 1);
  368. succ_con->expr = gfc_copy_expr (con->expr);
  369. mpz_sub_ui (succ_con->repeat, con->repeat, 1);
  370. mpz_set_si (con->repeat, 1);
  371. }
  372. }
  373. break;
  374. case REF_COMPONENT:
  375. if (init == NULL)
  376. {
  377. /* Setup the expression to hold the constructor. */
  378. expr->expr_type = EXPR_STRUCTURE;
  379. expr->ts.type = BT_DERIVED;
  380. expr->ts.u.derived = ref->u.c.sym;
  381. }
  382. else
  383. gcc_assert (expr->expr_type == EXPR_STRUCTURE);
  384. last_ts = &ref->u.c.component->ts;
  385. /* Find the same element in the existing constructor. */
  386. con = find_con_by_component (ref->u.c.component,
  387. expr->value.constructor);
  388. if (con == NULL)
  389. {
  390. /* Create a new constructor. */
  391. con = gfc_constructor_append_expr (&expr->value.constructor,
  392. NULL, NULL);
  393. con->n.component = ref->u.c.component;
  394. }
  395. break;
  396. default:
  397. gcc_unreachable ();
  398. }
  399. if (init == NULL)
  400. {
  401. /* Point the container at the new expression. */
  402. if (last_con == NULL)
  403. symbol->value = expr;
  404. else
  405. last_con->expr = expr;
  406. }
  407. init = con->expr;
  408. last_con = con;
  409. }
  410. mpz_clear (offset);
  411. gcc_assert (repeat == NULL);
  412. if (ref || last_ts->type == BT_CHARACTER)
  413. {
  414. if (lvalue->ts.u.cl->length == NULL && !(ref && ref->u.ss.length != NULL))
  415. return false;
  416. expr = create_character_initializer (init, last_ts, ref, rvalue);
  417. }
  418. else
  419. {
  420. /* Overwriting an existing initializer is non-standard but usually only
  421. provokes a warning from other compilers. */
  422. if (init != NULL)
  423. {
  424. /* Order in which the expressions arrive here depends on whether
  425. they are from data statements or F95 style declarations.
  426. Therefore, check which is the most recent. */
  427. expr = (LOCATION_LINE (init->where.lb->location)
  428. > LOCATION_LINE (rvalue->where.lb->location))
  429. ? init : rvalue;
  430. if (gfc_notify_std (GFC_STD_GNU,
  431. "re-initialization of %qs at %L",
  432. symbol->name, &expr->where) == false)
  433. return false;
  434. }
  435. expr = gfc_copy_expr (rvalue);
  436. if (!gfc_compare_types (&lvalue->ts, &expr->ts))
  437. gfc_convert_type (expr, &lvalue->ts, 0);
  438. }
  439. if (last_con == NULL)
  440. symbol->value = expr;
  441. else
  442. last_con->expr = expr;
  443. return true;
  444. abort:
  445. if (!init)
  446. gfc_free_expr (expr);
  447. mpz_clear (offset);
  448. return false;
  449. }
  450. /* Modify the index of array section and re-calculate the array offset. */
  451. void
  452. gfc_advance_section (mpz_t *section_index, gfc_array_ref *ar,
  453. mpz_t *offset_ret)
  454. {
  455. int i;
  456. mpz_t delta;
  457. mpz_t tmp;
  458. bool forwards;
  459. int cmp;
  460. for (i = 0; i < ar->dimen; i++)
  461. {
  462. if (ar->dimen_type[i] != DIMEN_RANGE)
  463. continue;
  464. if (ar->stride[i])
  465. {
  466. mpz_add (section_index[i], section_index[i],
  467. ar->stride[i]->value.integer);
  468. if (mpz_cmp_si (ar->stride[i]->value.integer, 0) >= 0)
  469. forwards = true;
  470. else
  471. forwards = false;
  472. }
  473. else
  474. {
  475. mpz_add_ui (section_index[i], section_index[i], 1);
  476. forwards = true;
  477. }
  478. if (ar->end[i])
  479. cmp = mpz_cmp (section_index[i], ar->end[i]->value.integer);
  480. else
  481. cmp = mpz_cmp (section_index[i], ar->as->upper[i]->value.integer);
  482. if ((cmp > 0 && forwards) || (cmp < 0 && !forwards))
  483. {
  484. /* Reset index to start, then loop to advance the next index. */
  485. if (ar->start[i])
  486. mpz_set (section_index[i], ar->start[i]->value.integer);
  487. else
  488. mpz_set (section_index[i], ar->as->lower[i]->value.integer);
  489. }
  490. else
  491. break;
  492. }
  493. mpz_set_si (*offset_ret, 0);
  494. mpz_init_set_si (delta, 1);
  495. mpz_init (tmp);
  496. for (i = 0; i < ar->dimen; i++)
  497. {
  498. mpz_sub (tmp, section_index[i], ar->as->lower[i]->value.integer);
  499. mpz_mul (tmp, tmp, delta);
  500. mpz_add (*offset_ret, tmp, *offset_ret);
  501. mpz_sub (tmp, ar->as->upper[i]->value.integer,
  502. ar->as->lower[i]->value.integer);
  503. mpz_add_ui (tmp, tmp, 1);
  504. mpz_mul (delta, tmp, delta);
  505. }
  506. mpz_clear (tmp);
  507. mpz_clear (delta);
  508. }
  509. /* Rearrange a structure constructor so the elements are in the specified
  510. order. Also insert NULL entries if necessary. */
  511. static void
  512. formalize_structure_cons (gfc_expr *expr)
  513. {
  514. gfc_constructor_base base = NULL;
  515. gfc_constructor *cur;
  516. gfc_component *order;
  517. /* Constructor is already formalized. */
  518. cur = gfc_constructor_first (expr->value.constructor);
  519. if (!cur || cur->n.component == NULL)
  520. return;
  521. for (order = expr->ts.u.derived->components; order; order = order->next)
  522. {
  523. cur = find_con_by_component (order, expr->value.constructor);
  524. if (cur)
  525. gfc_constructor_append_expr (&base, cur->expr, &cur->expr->where);
  526. else
  527. gfc_constructor_append_expr (&base, NULL, NULL);
  528. }
  529. /* For all what it's worth, one would expect
  530. gfc_constructor_free (expr->value.constructor);
  531. here. However, if the constructor is actually free'd,
  532. hell breaks loose in the testsuite?! */
  533. expr->value.constructor = base;
  534. }
  535. /* Make sure an initialization expression is in normalized form, i.e., all
  536. elements of the constructors are in the correct order. */
  537. static void
  538. formalize_init_expr (gfc_expr *expr)
  539. {
  540. expr_t type;
  541. gfc_constructor *c;
  542. if (expr == NULL)
  543. return;
  544. type = expr->expr_type;
  545. switch (type)
  546. {
  547. case EXPR_ARRAY:
  548. for (c = gfc_constructor_first (expr->value.constructor);
  549. c; c = gfc_constructor_next (c))
  550. formalize_init_expr (c->expr);
  551. break;
  552. case EXPR_STRUCTURE:
  553. formalize_structure_cons (expr);
  554. break;
  555. default:
  556. break;
  557. }
  558. }
  559. /* Resolve symbol's initial value after all data statement. */
  560. void
  561. gfc_formalize_init_value (gfc_symbol *sym)
  562. {
  563. formalize_init_expr (sym->value);
  564. }
  565. /* Get the integer value into RET_AS and SECTION from AS and AR, and return
  566. offset. */
  567. void
  568. gfc_get_section_index (gfc_array_ref *ar, mpz_t *section_index, mpz_t *offset)
  569. {
  570. int i;
  571. mpz_t delta;
  572. mpz_t tmp;
  573. mpz_set_si (*offset, 0);
  574. mpz_init (tmp);
  575. mpz_init_set_si (delta, 1);
  576. for (i = 0; i < ar->dimen; i++)
  577. {
  578. mpz_init (section_index[i]);
  579. switch (ar->dimen_type[i])
  580. {
  581. case DIMEN_ELEMENT:
  582. case DIMEN_RANGE:
  583. if (ar->start[i])
  584. {
  585. mpz_sub (tmp, ar->start[i]->value.integer,
  586. ar->as->lower[i]->value.integer);
  587. mpz_mul (tmp, tmp, delta);
  588. mpz_add (*offset, tmp, *offset);
  589. mpz_set (section_index[i], ar->start[i]->value.integer);
  590. }
  591. else
  592. mpz_set (section_index[i], ar->as->lower[i]->value.integer);
  593. break;
  594. case DIMEN_VECTOR:
  595. gfc_internal_error ("TODO: Vector sections in data statements");
  596. default:
  597. gcc_unreachable ();
  598. }
  599. mpz_sub (tmp, ar->as->upper[i]->value.integer,
  600. ar->as->lower[i]->value.integer);
  601. mpz_add_ui (tmp, tmp, 1);
  602. mpz_mul (delta, tmp, delta);
  603. }
  604. mpz_clear (tmp);
  605. mpz_clear (delta);
  606. }